Server Side Sorting initilized from XML with a frozen column

Hi,



I am experiencing an issue with the latest DHTMLX Grid control when using the SplitAt() function and server side sorting. When I use the following code, the sort order on the first (frozen) column is never reversed from “asc”. Removing the SplitAt() call from the XML then correctly toggles between “asc” and “des” correctly.



Can you advise on a fix for this problem, so I can use server side sorting and frozen columns at the same time?



Thanks,



Chris





function createGrid(url) {

    mygrid = new dhtmlXGridObject(‘table_container’);

    mygrid.setImagePath("$siteroot/content/lib/dhtmlx/2/dhtmlxGrid/codebase/imgs/");

    mygrid.setSkin(“platinum_manager”);

    mygrid.enableRowsHover(true,‘grid_hover’);        

    mygrid.preventIECaching(true);

    mygrid.attachEvent(“onBeforeSorting”,onBeforeSort);

    mygrid.load(url);    

}



function onBeforeSort(columnIndex,grid,direct){

    mygrid.clearAll();

    mygrid.loadXML("$Url" + “&orderBy=” + columnIndex + “&direction=” + direct);

    mygrid.setSortImgState(true,columnIndex,direct);

    return false;

}



<?xml version="1.0" encoding="utf-8" ?>





    

    

        1

    

    

        true

        50

    

    

    Domain

    TLD

    Country

    

    … all columns …

    

    Portfolio sections







    … table data…





The grid in split mode has next limitation - the structure of grid can’t be redefined after splitAt command. Which means you can’t reload configuration of such grid from XML. If loadXML, called on sorting will fetch data with head/column tags - grid will try to redefined structure , which will cause an error.

If your server side code will load only data part of grid, when server side sorting occurs - data will be correctly reordered in both parts of grid
( yout server side code must not ouput head section  if orderBy parameter specified )


I can confirm that on the re-sort request I am not returning the header information.  On the server I get 2 requests from the grid and return the following XML:



1st Request: Position Start=0, Count=0, OrderBy=0, Direction=asc



<?xml version="1.0" encoding="utf-8" ?>



2nd Request: Position Star=0, Count=50, OrderBy=0, Direction=asc



<?xml version="1.0" encoding="utf-8" ?>

 
 
   … table data…
 
 




The direction parameter never changes to “des”.  Also, is it correct to send the 1st request as empty XML?



Thanks,



Chris



 



 

The direction parameter never changes to “des”.  Also, is it correct to send the 1st request as empty XML?
It must not cause any problems ( you can send data immideatly at first request, to prevent double calls, but still it not a problem )

>>The direction parameter never changes to “des”.  Also, is it correct to send the 1st request as empty XML?
Please contact us directly at support@dhtlmx.com - we will provide you an updated version of split code, which may resolve issue.