Categories | Question details Back To List | ||
dhtmlXTreeGrid sorting Hi I have Issue with dhtmlXTreeGrid sorting Q1. I am using dhtmlXGridObject to create a tree, each row has multiple columns one of the columns has image, initially sorting works fine but after clicking of that image (which opens new window that navigates to another URL), if I sort it does not work. My Sample code mygrid = new dhtmlXGridObject('gridbox'); mygrid.setImagePath('codebase/imgs/'); mygrid.setHeader("Column A, Column B,Column C Column D"); mygrid.setInitWidths("100,100,100,100") mygrid.setColAlign("right,left,right,right") mygrid.setColTypes("tree,ro,ro,ro"); mygrid.setColSorting("int,int,int,int") mygrid.init(); mygrid.loadXML("grid.xml"); XML <?xml version="1.0" encoding="UTF-8"?> <rows> <row id="1"> <cell>123456.78</cell><cell><a href= \"#\"><span class='rVR' onclick='myfunction()'> <img border=\"0\" src='folder.gif'/>123456.78</span></a></cell><cell>1256.78</cell><cell>3456.78</cell> </row> <row id="2"> <cell>93456.78</cell><cell>1456.78</cell><cell>1236.78</cell><cell>1256.78</cell> </row> </rows> Q2. I have requirement where on click of one of the cell which is a button I need to delete node and refresh with new data I am using mygrid.deleteChildItems(ID) it works fine, but if I click sort on a column and then click on button I am getting error message 'parent.childs[...] is null or not an object, when I debug found error in remove function of dthmlxtreegrid.js file z.index is becoming -1, Thanks Pitta Answer posted by Support on Oct 16, 2008 03:07 >>Q1. I am using dhtmlXGridObject to create a tree, each row has multiple columns The XML snippet which you are using is not correct, inline tags will not be processed in expected way, you need to update it as <cell>123456.78</cell><cell><![CDATA[<a href= "#"><span class='rVR' onclick='myfunction()'> <img border="0" src='folder.gif'/>123456.78</span></a>]]></cell><cell>1256.78</cell><cell>3456.78</cell> With updated XML - sample component works correctly and problem can't be reconstructed. (sample sent by email ) Answer posted by Support on Oct 16, 2008 03:08 >>Q2. I have requirement where on click of one of the cell which is a button I need to delete node and refresh with new data Issue not reconstructable locally. If it still occurs for you - please provide any kind of sample. The updated version of dhtmlxtreegrid.js sent by email, it contains few updates which may resolve issue - please try to use it instead of original one. Answer posted on Oct 16, 2008 18:54 Thanks, I am using DOM4J to constuct XML DOM as below so i believe XML parser would to care,please let me otherwise if i need to add ![CDATA[ org.dom4j.Document document1 = (org.dom4j.Document) DocumentHelper.createDocument(); Thanks Pitta Answer posted by Support on Oct 17, 2008 04:27 >> I am using DOM4J to constuct XML DOM as below so i believe XML parser would to care Yes, it must insert CDATA or escape characters automatically, you need not change anything |