Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ng-grid paging
Message
 
 
General information
Forum:
Javascript
Category:
Other
Title:
Miscellaneous
Thread ID:
01609778
Message ID:
01609864
Views:
31
>>>>This is an interesting question - the code in the controller is auto-generated (we then add more logic). Why it is set this way I am not sure myself.
>>>>
>>>>Also, yesterday I commented out the paging options and enablePaging and still the behavior was the same. So, the problem is not in the paging, the problem is that when my data change, somehow grid doesn't react and display them. Only by switching to dev tools I can get it to react to that new data set.
>>>
>>>In an MVVM situation which from my reading is what Angular Js is all about, for a control to update, it has to be notified that the underlying binding has been changed. In Silverlight/wpf that is handled by INotifyPropertyChanged and all works great. I'm sure there is a similar mechanism in Angular which you are not calling after mucking around with sort, etc.
>>
>>Yes, I was thinking about it too yesterday that I have to explicitly call something now. I'm going to do some research in this direction today.
>
>It shouldn't be needed - except in rare cases.
>
>One is when $scope is not aware of changes.
>Your use of the js timeout() function was an example of that: $scope won't know what happened inside the function - you should use angularjs $timeout() instead (which automatically generates an $apply().
>But I don't think you have timeout() anymore ?
>
>Another to watch out for is callbacks where $scope (and other objects) may not be accessible because of closure.

Hi Viv,

I found this question https://stackoverflow.com/questions/17529559/angularjs-ng-grid-updating-array-with-splice-doesnt-updates-ui which perhaps is relevant to my case.

Unfortunately, I can not check if it's relevant or not as we only have ng-grid.min.js in our project. I am not exactly sure where to try implementing the copy solution suggested in the second answer.

BTW, I posted all the code which I currently have in that controller (aside from the few irrelevant methods). May be you can spot the problem right away.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform