Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by dhtmlxfan on Jul 15, 2009 00:34
open dhtmlx forum
Paging and SerializeToCSV

Hi,

I am using dhtmlxgrid pro and created grid with

mygrid = new dhtmlXGridObject('mygrid_container');
mygrid.setImagePath("/img/imgs/");
mygrid.setHeader("h1,h2,h3,h4");
mygrid.setInitWidths("*,100,100,100");
mygrid.setColAlign("left,center,center,center");
mygrid.setColSorting("server,server,server,server");
mygrid.attachEvent("onBeforeSorting",sortGridOnServer);
mygrid.setSkin("modern");
mygrid.enablePaging(true,500,10,"pagingArea",true,"recinfoArea");
mygrid.setPagingSkin("bricks");


However i cannot get export to CSV to work. The error happens when I call mygrid.serializeToCSV().

mygrid.loadXML(gridQString, function(){
var mygrid.setCSVDelimiter("\t");
strGridXML = mygrid.serializeToCSV();
});

nor am I amble to serialize to CSV with

function exportCSV() {
    mygrid.setCSVDelimiter("\t")
var strGridXML = mygrid.serializeToCSV();
    document.forms[0].csv.value = strGridXML;
document.forms[0].submit();
}
Answer posted by dhxSupport on Jul 15, 2009 02:57
>>The error happens when I call mygrid.serializeToCSV()
Please check if you have attach dhtmlxgrid_nxml.js file to your page. Note serializeToCSV() method is availible in PRO version only.
Answer posted by dhtmlxfan on Jul 15, 2009 14:12
I have put in htmlxgrid_nxml.js and i DO have PRO version.  Any other thoughts on why there is the problem with serializeToCSV?
Answer posted by dhxSupport on Jul 16, 2009 01:26
You code looks correct. Which issue do you have while serialization grid to CSV format. Does browser returns any error. If it possible please provide us full sample where we can reproduce this issue.