Categories | Question details Back To List | ||
No Data in Grid I get a table with the headers but no data is populated from the xml file and no errors: <html> <title>dhtmlxGrid Sample Page</title> <link rel="STYLESHEET" type="text/css" href="dhtmlxgrid.css"> <script src="dhtmlxcommon.js"></script> <script src="dhtmlxgrid.js"></script> <script src="dhtmlxgridcell.js"></script> <script> var mygrid; function doInitGrid(){ mygrid = new dhtmlXGridObject('mygrid_container'); mygrid.setImagePath("/imgs/"); mygrid.setHeader("1,2,3,4,5,6"); mygrid.setInitWidths("*,150,150,*,*,*"); mygrid.setColAlign("left,right,right,right,right,right") mygrid.setSkin("light"); mygrid.setColSorting("str,int,int,int,int,int"); mygrid.setColTypes("ed,ed,price,ed,ed,ed"); mygrid.attachEvent("onRowSelect",doOnRowSelected); mygrid.init(); mygrid.loadXML("Varsity3.xml"); } function addRow(){ var newId = (new Date()).valueOf() mygrid.addRow(newId,"",mygrid.getRowsNum()) mygrid.selectRow(mygrid.getRowIndex(newId),false,false,true); } function removeRow(){ var selId = mygrid.getSelectedId() mygrid.deleteRow(selId); } function doOnRowSelected(rowID,celInd){ alert("Selected row ID is "+rowID+"\nUser clicked cell with index "+celInd); } </script> <body onload="doInitGrid()"> <div id="mygrid_container" style="width:600px;height:150px;"></div> </body> </html> Answer posted by dhxSupport on Jun 11, 2009 01:23 Please check if Varsity3.xml file contain any data. Answer posted by jeffsal on Jun 11, 2009 05:53 Here is a portion of the xml file which was exported from an access database: <?xml version="1.0" encoding="UTF-8"?> Answer posted by dhxSupport on Jun 11, 2009 07:35 You are using not standart type of xml. Please see more infomation here how to implement custom xml type http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Loading_data_in_grid.html#grid_art_loadingdata http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Custom_loading_types.html#grid_art_custloadtypes |