custom sorting - sortingAlgorithm docu vs code
The sortingAlgorithm in docu does not conform to the present implementation.
In docu there is example http://ui-grid.info/docs/#/tutorial/102_sorting
columnDefs: [ { ...
sort: { ...
sortingAlgorithm: function(a, b) { ... }
}
}
After debugging the ng-grid code, present code accepts only this:
columnDefs: [ { ...
sort: { ...
},
sortingAlgorithm: function(a, b) { ... }
}
Either docu doesn't conform to the code, or vice versa. Also - the second plunkr example at http://ui-grid.info/docs/#/tutorial/102_sorting doesn't work (json data missing).
For reference, please see https://github.com/angular-ui/ng-grid/blob/b622a1c7fd9537ec3309d53deaef2cac60d96fff/src/js/core/services/rowSorter.js#L269
In tutorial docu at http://ui-grid.info/docs/#/tutorial/102_sorting please see the second example - tab "app2.js" - sortingAlgorithm is placed incorrectly inside sort insted of 1 level up - so the tutorial example doesn't work. If the implementation is ok, then the tutorial should be fixed as described above - sortingAlgorithm should be 1 level up.
Please note also the last sentence in 1.st comment - ... the second plunkr (and also jsfiddle) example at http://ui-grid.info/docs/#/tutorial/102_sorting doesn't work (json data missing).
Yeah, I had a look at that. It has exactly the same code as the grid above. I think the problem is the logic that puts it into the plunker, which is changing the file name to match the name plunker needs. I'm still thinking on options to resolve that.