I'm an AngularJS newbie - if this is covered elsewhere, I'd appreciate a 
link to it...

I have a grid which receives data from a database query. It presents a 
subset of the results and allows for single row selection:

>   $scope.eventGridOptions = {
>
>     data: 'eventData',
>
>     selectedItems: $scope.myEventSelections,
>
>     multiSelect: false,
>
>     jqueryUITheme: true,
>
>     showFilter: true,
>
>
I have a form which takes its values from *$scope.myEventSelections[0]*, 
which has input fields for all of the fields and that works fine. Editing 
the form fields results in the changes being mirrored in the grid.

BUT

I'd like to provide the analog of a reset() command. Upon selection of a 
row, I've copied the row data to a variable, so if a reset is desired, I 
can replace the contents of  *$scope.myEventSelections[0]* with the 
contents of the variable. This updates the form correctly, but the changes 
are not mirrored in the grid. Furthermore, this breaks the binding for the 
whole form. No updates are mirrored until I select a new row - then normal 
behaviors resume.

I have tried changing the *eventData* array using splice, but that's to no 
effect.

I've tried wrapping the code in $scope.$apply, but this, too, has no effect.

So my questions are:

   - Is there a way to mimic reset() on a form bound to an ng-grid?
   - Is there a way to manipulate the values in a form bound to an ng-grid 
   without breaking binding?

Thanks
 

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to