KoGrid
KoGrid copied to clipboard
self.sortData has javascript error 'sortInfo is not defined' in 2 spots
self.sortData = function (col, direction) {
// if external sorting is being used, do nothing.
self.isSorting = true;
self.sortInfo({
column: col,
direction: direction
});
self.clearSortingData(col);
if(!self.config.useExternalSorting){
window.kg.sortService.Sort(sortInfo, self.sortedData);
} else {
self.config.sortInfo(sortInfo);
}
self.lastSortedColumn = col;
self.isSorting = false;
};
The sortInfo variable is not defined and therefore throws a javascript Uncaught ReferenceError: sortInfo is not defined. You can see it in the following fiddle as well - http://jsfiddle.net/zSpMh/2/ after you try sorting the first column.
This should fix the issue :). Thanks for finding that!
OK so after that fix my computed function which responds to any changes to sortInfo gets called twice. See fiddle console log for example http://jsfiddle.net/zSpMh/3/. Do I have to change the way I do my computed function? Or maybe does that new hotfix need to change?
I want to say that self.sortInfo has a reference to self.config.sortInfo because if you evaluate self.sortInfo() === self.config.sortInfo() in that self.sortData function it always evaluates to true. Not sure if that helps.
I'll look into it, I am going to change the title but it should only get called once.
I'm also getting into the same problem. The serverside sorting gets called twice.
Thanks for KoGrid, BTW. :)
sortInfo gets called twice, is this issue fixed?