Hello,
I have successfully loaded a DHTMLXgrid from JSON. I am trying to load into a TreeGrid and group by Month and then by Year, and sum over a number of hours. I have checked and my JSON is valid:
{"rows":[{"id":"2013", "rows": [{"id":"02", "rows": [{"id":"34031", "data": ["2013","02","25/02/2013","10:00","","0"]}], "data":["thisYear", "thisMonth", "x", "x", "x", "x"]},{"id":"03", "rows": [{"id":"34397", "data": ["2013","03","04/03/2013","10:00","11:00","1"]},{"id":"34074", "data": ["2013","03","14/03/2013","10:00","11:30","1.5"]},{"id":"34144", "data": ["2013","03","21/03/2013","10:00","11:30","1.5"]},{"id":"34323", "data": ["2013","03","25/03/2013","10:00","11:30","1.5"]}], "data":["thisYear", "thisMonth", "x", "x", "x", "x"]},{"id":"04", "rows": [{"id":"34496", "data": ["2013","04","11/04/2013","10:00","11:00","1"]}], "data":["thisYear", "thisMonth", "x", "x", "x", "x"]}], "data":["thisYear", "thisMonth", "x", "x", "x", "x"]}]}
Here is a snippet of code from my js (also, I commented out myGrid1.setMathRound(2) as I got an error that this was not a function):
myGrid1.setHeader("Year, Month, Date, Start, End, Duration");
myGrid1.setInitWidths("50,50,70,70,70,70");
myGrid1.setColAlign("left, left,center,center, center,right");
myGrid1.setColTypes("tree,tree,ro,ro,ro,ed[=sum]");
myGrid1.setColSorting("str,str,str,str,str,int");
//myGrid1.setMathRound(2);
myGrid1.init();
myGrid1.setSkin("dhx_skyblue");
var url1 = "getJSON.php;
myGrid1.load(url1,"json");
Thanks in advance for any pointers on what I am doing wrong!!
Cheers,