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"?>
123456.78<a href= “#”> <img border=“0” src=‘folder.gif’/>123456.781256.783456.78
93456.781456.781236.781256.78
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
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
123456.78<![CDATA[123456.78]]>1256.783456.78
With updated XML - sample component works correctly and problem can’t be reconstructed. (sample sent by email )
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.
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();
org.dom4j.Element rowsElement1 = document1.addElement(“rows”);
rowsElement1.addAttribute(“parent”, “Honda”);
org.dom4j.Element cellElement1 = rowElement1.addElement(“cell”);
cellElement1.setText("<span class=‘rVR’ onclick=“navigateAway(true);”><a href= “#”>"+unitItem.getVIN()+"
Thanks
Pitta
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