groupBy when using mygrid.parse()

Hi all,
I am trying to use groupBy for my grid.
When I use mygrid.load(), the groupBy works fine. But when I use mygrid.parse(), the groupBy does not work.
Anyone have any ideal of this.
Thanks.


myGrid = myLayout.cells("a").attachGrid();
	myGrid.setImagePath("codebase/imgs/");
	myGrid.setHeader("ID,Latitude,Longitude,Method,Status,Time");
	myGrid.setInitWidths("70,80,80,70,70,*");
	myGrid.setColAlign("left,left,left,left,left");
	myGrid.setColTypes("ro,ro,ro,ro,ro,ro");
	myGrid.setColSorting("str,str,str,str,str,str");
	myGrid.attachHeader("#text_filter,#text_filter,#text_filter,#text_filter,#text_filter,#text_filter");
	myGrid.attachEvent("onRowDblClicked",showmarker);
	//myGrid.groupBy(0); does not work
	myGrid.init();
	myGrid.parse("arr","jsarray");
//    but it works with myGrid.load();

You need to call the groupBy() method after the data is loaded to the grid:
myGrid.init();
myGrid.parse(“arr”,“jsarray”);
myGrid.groupBy(0);

Thanks for your reply.
Actually I tried that before but it does not work either.

myGrid = myLayout.cells("a").attachGrid();
	myGrid.setImagePath("codebase/imgs/");
	myGrid.setHeader("ID,Latitude,Longitude,Method,Status,Time");
	myGrid.setInitWidths("70,80,80,70,70,*");
	myGrid.setColAlign("left,left,left,left,left");
	myGrid.setColTypes("ro,ro,ro,ro,ro,ro");
	myGrid.setColSorting("str,str,str,str,str,str");
	myGrid.attachHeader("#text_filter,#text_filter,#text_filter,#text_filter,#text_filter,#text_filter");
	myGrid.attachEvent("onRowDblClicked",showmarker);
	myGrid.init();
	myGrid.parse("arr","jsarray");
	myGrid.groupBy(0);

Unfortunately the issue cannot be reproduced locally.
groupBy() method works well for me in case of using the parse() method loading the data from the jsarray
If the problem still occurs for you please, provide with a complete demo, where the problem can be reconstructed locally.

Thanks for your replay.
Please see the uploaded demo. Because of the file size restriction, I didn’t upload the dhtmlx library and jquery.js.
demo.zip (3.85 KB)

Please, try to replace:
myGrid.parse(“arr”,“jsarray”);
with:
myGrid.parse(arr,“jsarray”);

Still not working. :frowning:
It works fine for all my other pages but this one… :frowning:

Please, make sure that your data is loaded correctly trying to add some alert after the parse() and check if it’s appear.
If the problem still occurs for you please, open ticket on support.dhtmlx.com and provide with a complete demo, where the problem can be reconstructed or share with a demo link, where the issue can be reproduced.