-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for #645 and #632 #651
Conversation
Can you set up a demo so we can look at what sort of performance hit this will inflict? |
Here is the plunk used for #645: http://plnkr.co/edit/8qNVdI?p=preview The performance hit is only for when data changes. For #632, its a little more complicated. |
A deep watch on our collection backing the grid would be a show stopper. Our objects are very complex and we might only show 10 columns in the grid, but have over 100 properties in the objects bound the collection. I should add that our biggest complaint about the grid so far is performance. Anything that slows it down that is not some optional setting just won't work. To be realistic with your plunker, add about 15 - 20 columns over 10,000 items. I know that we shouldn't be using 10,000 items in a grid and I don't do that. But most tests concentrate on many rows while I see many columns being a much bigger issue. |
Alright, maybe the best bet here is to add an option (watchData or updateOnDataChange) for doing watching in general. Have it default to true for the current identity watches and if the user sets it to 'deep', then we do a deep watch. Then when we can do shallow watching, we can just make it strictly true/false. I added 50 columns and tested out the changes without doing a deep watch and it still looks like it works fine to me. I will try to update the plunks to showcase rows as well as columns and and the new option to the pull request sometime this weekend. @swalters, just curious, do any of your usages add/remove multiple items at a time from the grid or is mostly editing the items after the initial load? I ask because both of these bugs seem like fairly big functionality issues and I wondering how I'm the first to find them. |
@wattsbn We never actually remove items from the grid, we just flag them as removed. When the rows are physically removed, we are reloading the entire array. It's more of a batch operation where the user makes all of their changes, then saves the changes. When can we officially support the $watchCollection? |
$watchCollection was added into AngularJS in version 1.1.4. So either we wait for it to become a stable version (not sure how long that takes) or start using the unstable version (which is not my call to make). |
Added an 'watchData' as an option to the grid configuration options object. It defaults to true, in which case it does an identity watch. If set to 'deep', then it does a deep watch.
@wattsbn What if we added an if(isFunction($scope.$watchCollection))? Anyone on 1.1.4 or higher would benefit. @roblarsen Too much of a hack? It would be a pain to test against older Angular versions. |
grid.init() is now called here, not in src/classes/grid.js. It returns a promise which delays the execution until everything is ready (templates, and whatever else init() does).
Hi, thanks for this PR. As we move towards releasing 2.0.8 and then soon after moving to the new architecture of 3.0, we're going closing many issues and PRs. This will allow us to make better use of the issue tracker for the project moving forward. We really appreciate your input and hope to do a better job of managing PRs and issues with 3.0. |
Fixes for #645 and #632
Both fixes are going to decrease performance, but I think the hit is necessary to fix these bugs.
We can use $watchColleciton whenever we start using angular 1.1.4