I used the fuction for the csv/excel grid exportation, but in my grid I use link columns, and in the csv file the link appears like it can be viewed in th xml
It’s there any method to choose what columns are exported o to parse the grid in the exportation?
and also the headers can be exported?
Thanks
I used the fuction for the csv/excel grid exportation, but in my grid I use link columns, and in the csv file the link appears like it can be viewed in th xml
Serialization was designed to allow you to load grid again from the serialized xml or csv string. If link columns will not serialized like it viewed in the xml you will not able to load grid from the serialized string again.
>>It’s there any method to choose what columns are exported o to parse the grid in the exportation?
You can use method setSerializableColumns(list) where list - list of true/false values separated by comma, if list empty then all fields will be serialized
>>and also the headers can be exported?
In case of csv serialization you can use method enableCSVHeader(mode) where mode - true/false.
In case of xml serialization you can use method setSerializationLevel(userData, fullXML, config, changedAttr, onlyChanged, asCDAT) where
# userData - enable/disable user data serialization
# fullXML - enable/disable full XML serialization (selection state)
# config - serialize grid configuration
# changedAttr - include changed attribute
# onlyChanged - include only Changed rows in result XML
# asCDATA - output cell values as CDATA sections (prevent invalid XML)
Thanks for the answer, but now I have this problems:
I’ve add this to the grid
mygrid.setSerializableColumns(false,true,true,true,true,true,true);
but the column marqued with the false statment still appearing in the csv file,
mygrid.enableCSVHeader(true);
in the csv file, the row id is also showed, so the header are moved, cause that extra column, is there any way to move the header a little?
Thanks!
but the column marqued with the false statment still appearing in the csv file,
setSerializableColumns(list) has parameter - string which is a list of true/false values:
mygrid.setSerializableColumns(“false,true,true,true,true,true,true”);
>>in the csv file, the row id is also showed, so the header are moved, cause that extra column, is there any way to move the header a little
Add following command to grid initialization:
mygrid.enableCSVAutoID(true);