- Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
My data can contain null values. While porting from ng-grid 2.0.1 to 2.0.7, I noticed that my custom sortFn function that sorts nulls to the top of an ascending list no longer works. It did that by assigning NaNs to 0.
In ng-grid-2.0.7.debug.js I notice this comment on line 470:
// we want to force nulls and such to the bottom when we sort... which effectively is "greater than"
For my purposes that's not true. Nulls should be sorted as though they were 0s. I am getting around this behavior by replacing the logic starting on line 469 with calling sortFn and allowing sortFn's definition to do the substitution:
tem = sortFn(propA, propB);
But, I would like to see this assumption revised, since I couldn't come up with a sortFn to pass in that would overcome the incorrect assumption.