Categories | Question details Back To List | ||
dhtmlXGrid sort order I have an application which uses the grid to display rows with uniqueIDs and checkboxes for row values. The functionality is supposed to allow the user to "check" the rows he wants and save the values of those checked rows. After the initial data retrieve, the grid is able to correctly provide row values (e.g. uniqueID associated with checked row), but after the user sorts the grid by a particular column, it seems as if the the grid values dont match the new "sort order". The grid gives incorrect row results (e.g. the checked row content doesnt match the new sort content) How can I make sure that the grid data after a grid sort matches and is kept in synch? Answer posted on Jun 25, 2007 10:54 Can you please send some kind of example, because problem is not reconstructable locally. ID is linked to rows and doesn't affected by sorting, I don't see any way how sorting can affect row IDs, but grid has alternative coordinate system - row Index - position of row in grid, which affected by sorting. Please check that you uses rowIDs, not rowIndexes Answer posted by techtigre on Jun 26, 2007 04:56 We decided to let the server sort our results and then reload the gridObj again. We 're using a custom sort function and it appears to be working well. For those interested, our code is similar to this (sniippets only): //grid initialization section mygrid.setOnColumnSort(sort_column); mygrid.init(); mygrid.setColSorting("na,na,na,na,na,na,na,na"); //custom sort function function sort_column(colIndx,gridObj,directn) { var tmp = mygrid.getSortingState(); //we then determine which direction the arrow should point //and which hdr column was pressed in order to send this //info to our server side search/sort routine .... } //handler function after search call var handlerFunc = function(t) { try { var xmlDoc = t.responseText; mygrid.loadXMLString(xmlDoc); mygrid.setSortImgState(true,sortColIndx,sortdirection.toUpperCase()); ... } Answer posted by Inga (Support) on Dec 07, 2014 06:38 To find more precise comments upon this issue, we can offer you read about slider control and eclipse auto completion. |