Categories | Question details Back To List | ||
Serialized Data is invalid [DHTMLx-TreeGrid] Hi, the output of your serialized data is invalid. If i have a treegrid with child-rows are not closed properly. The second thing is, that the CSS-Classes are not serialized. I gave some Rows a CSS-Class and this information is not serialized. Please give me some information how to realize this problem. Here is an example: HTML-Code: --------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <link rel="STYLESHEET" type="text/css" href="css/dhtmlxGrid/dhtmlxgrid.css"> <link rel='STYLESHEET' type='text/css' href='css/common/style.css'> <script type="text/javascript" src="js/dhtmlxGrid/dhtmlxcommon.js"></script> <script type="text/javascript" src="js/dhtmlxGrid/dhtmlxgrid.js"></script> <script type="text/javascript" src="js/dhtmlxGrid/dhtmlxgridcell.js"></script> <script type="text/javascript" src="js/dhtmlxTreeGrid/dhtmlxtreegrid.js"></script> <script language="JavaScript" type="text/javascript"> function serializeGrid(){ mygrid.setSerializationLevel(true,false,true,false,false,false); var myXmlStr = mygrid.serialize() document.getElementById("mytextarea").value = myXmlStr; } </script> </head> <body> <table width="200" class="table" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <div id="gridbox" style="width:100%;height:200px"></div> </td> </tr> <tr> <td> <a href="#" onclick="serializeGrid()">Export</a> </td> </tr> </table><br><br> <textarea name="mytextarea" id="mytextarea" rows="20" cols="80"></textarea> <script type="text/javascript"> mygrid = new dhtmlXGridObject('gridbox'); mygrid.imgURL = "images/tree/"; mygrid.enableColSpan(true); mygrid.init(); mygrid.loadXML("test.xml"); </script> </body> </html> Here is the original XML-Data: ------------------------------------ <?xml version="1.0"?> <rows> <head> <column width="100" type="tree" align="left" color="white" sort="na"> </column> <column width="100" type="ed" align="left" sort="na">1</column> <settings> <colwidth>px</colwidth> </settings> </head> <row id="root" class="knot" open="1"> <cell image="folder.gif">Ergebnis</cell> <cell>2</cell> <row id="row_1"> <cell/> <cell>3</cell> </row> </row> </rows> Answer posted by Support on Sep 03, 2008 02:50 >>If i have a treegrid with child-rows are not closed properly Problem confirmed and fixed - please contact us directly at support@dhtmlx.com and provide your ref. number - we will send you an updated js file. >>I gave some Rows a CSS-Class class and style attributes not included in final serialization, this is expected behavior. Answer posted by Marcel on Sep 03, 2008 02:58 Hi, is it possible to code this behavior? Answer posted by Support on Sep 03, 2008 03:42 with latest version of grid (sent by email ) you can add next code grid init grid.xml.row_attrs=["class"]; it will force adding class attribute to the result XML Answer posted by Marcel on Sep 03, 2008 06:47 Hi, styleclass is exported fine (except the thing, that if no class class is given 'undefined' is exported). But the major bug with the invalid xml after is not fixed in the file you sent to me. regards Marcel Answer posted by Support on Sep 03, 2008 07:19 Working sample, which uses the same init code and XML, was sent by email. |