Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Carl on Mar 27, 2008 04:27
open dhtmlx forum
TreeGrid serialization error

Hi,

I'm trying to use the serialization() call on my TreeGrid to produce an XML representation of the grid - when I call it I get a pop up dialog saying:

Error type: Incorrect cell type: undefined
description: undefined

I also see a " 'cell' is null or not an object" error message in my browser.

My TreeGrid columns are defined as:

setColTypes("tree,coro,co,ed,ed,ed,ed,ed,ed,ed,ch,clist,coro");

I have tried setting the serializeLevel as:

setSerializationLevel(true, true, true, true, false, true);

I'm assuming that the problem is I have some cells that contain a null value - is that true, and if so, is there any way around this? If this is not the problem have you any ideas what else the problem could be?

I understand I may be a bit vague with my question and information here so please let me know if I can help with any other information. I am using the Professional version.

Thanks for any help.

The XML I use to sucessfully populate the grid is below - I have tried just loading the grid and doing a serialize straight away as well as loading the grid, doing some editing, and then serilaizing. serializeToCSV also has the same problem.

<?xml version='1.0' encoding='iso-8859-1'?><rows><userdata name="customerGRUA">GAME</userdata><userdata name="groupName">GAME_TC169</userdata><userdata name="ipAddressMode">IPV4</userdata><row open="1" id="cos.1"><cell>COS2</cell><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/><row open="1" id="ipv4.1"><cell>IPV4</cell><cell type="ro"/><cell type="ro"/><cell type="ro" style="font-weight:bold">lpv4 Addr</cell><cell type="ro" style="font-weight:bold">lpv4 subnet</cell><cell type="ro" style="font-weight:bold">ports</cell><cell type="ro" style="font-weight:bold">lpv4 Addr</cell><cell type="ro" style="font-weight:bold">lpv4 subnet</cell><cell type="ro" style="font-weight:bold">ports</cell><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/><row id="classification.1.ipv4.1"><userdata name="order">1</userdata><cell/><cell>Permit</cell><cell>80</cell><cell>135.56.34.23</cell><cell>255.255.0.0</cell><cell>514-516</cell><cell>135.56.76.23</cell><cell>255.255.0.0</cell><cell>514-516</cell><cell>51</cell><cell>0</cell><cell/><cell/></row></row><row open="1" id="ipv6.1"><cell>IPV6</cell><cell type="ro"/><cell type="ro"/><cell type="ro" style="font-weight:bold" colspan="2">lpv6 addr/prefix</cell><cell type="ro"/><cell type="ro" style="font-weight:bold">ports</cell><cell type="ro" style="font-weight:bold" colspan="2">lpv6 addr/prefix</cell><cell type="ro"/><cell type="ro" style="font-weight:bold">ports</cell><cell type="ro"/><cell type="ro"/><cell type="ro"/><cell type="ro"/></row></row></rows>
Answer posted on Mar 27, 2008 06:15
>>I'm assuming that the problem is I have some cells that contain a null value
Problem caused by colspan used in your grid.
Please be sure that your grid initialization code has
    grid.enableColSpan(true);
If problem still occurs for you please contact us directly at support@dhtmlx.com we will provide an updated file, which will resolve issue ( you can try to update to latest TreeGrid build, it already contains fix for serialization data with colspans )

>>serializeToCSV also has the same problem.
TreeGrid can't be serialized to CVS, this format works for plain grids only