I am getting the error “zx has no properties” when trying to serialize the grid to csv. I am currently using the updated dhtmlxGrid_nxml.js file that I found in the Knowledge Base. Also, I am NOT using the new 2.0 version of dhtmlxGrid. Thanks again for your great help!
The code I am using:
function exportToCsv()
{
mygrid.setCSVDelimiter("\t");//chnage csv delimiter
var csv = mygrid.serializeToCSV();
document.getElementById(‘test’).innerHTML = csv; // Just outputting the csv string here to test results
}
Here is the grid initialization in which I am trying to export:
var gridQString = “getGridRecords.php”;
var mygrid;
function doInitGrid()
{
mygrid = new dhtmlXGridObject(‘products_grid’);
mygrid.setImagePath("…/source/codebase/imgs/");
mygrid.setHeader(",Hospital,Total Purchase");
mygrid.setInitWidths(“30,350,985”);
mygrid.setColAlign(“center,left,right”);
mygrid.setSkin(“modern”);
mygrid.setColSorting(“server,server,server”);
mygrid.setColTypes(“sub_row,str,price”);
mygrid.init();
mygrid.enableSmartRendering(true);
mygrid.attachEvent(“onBeforeSorting”,sortGridOnServer);
mygrid.attachEvent(“onSubGridCreated”,doInitRegionalMinstrySubGrid);
mygrid.loadXML(gridQString );
}
This is known issue for version 1.6 - please use attached js file instead of original one, it will resolve problem.
dhtmlxgrid_nxml.zip (4.51 KB)