if xml file include “” tag, “setColSorting” function not working
it not include it, then working fine
var mygrid = new dhtmlXGridObject(‘mygrid_container’);
mygrid.setImagePath("…/dhtmlxSuite/dhtmlxGrid/codebase/imgs/");
mygrid.setHeader(“Department,Name,Email,Title”);
mygrid.setColumnIds(“dept,name,email,pos”)
mygrid.setInitWidths(“150,*,250,150”);
mygrid.setColAlign(“left,left,left,left”)
mygrid.setSkin(“modern”);
mygrid.setColSorting(“str,str,str,str”); <----- no use
mygrid.enableEditTabOnly(1);
mygrid.preventIECaching(true);
mygrid.enableRowsHover(true,‘grid_hover’)
mygrid.setActive(true);
mygrid.init();
mygrid.loadXML(“userInfo2.xml”);
userInfo2.xml
<?xml version="1.0" encoding="utf-8"?>
Department
dpt1
dpt1-1
dpt2
dpt2-1
dpt-3
dpt-31
name
Email
Title
12
frank1
aa@aa.mm
pos1
12
sss
aa@ssf
13
frank2
dd@aa.vv
pos2
14
frank3
cc@xx.cc
if xml file include “” tag, “setColSorting” function not working
This is expected behaviour.If you have defined grid cofiguration with API and then load grid with configuration part, API’s configuration will be overloaded.
If you have in your xml you can set columns sorting using “sort” attribute:
Please find more information here dhtmlx.com/docs/products/docsExp … dhtmlx_xml