Infinite loop when get 2 records

When i have 4k records dhtmlxgrid shows perfectly. However, when grid has 2 records it goes infinite loop.

column 0 has 4k distinct records,
column 2 has 2 distinct records.

4k records: (fine)

2 records: (infinite loop)

Error type: LoadXML
Description: Incorrect XML

[code]sqlResultGrid.setImagePath(“<?=base_url()?>themes/third_party/dhtmlx/dhtmlxGrid/codebase/imgs/”);
sqlResultGrid.setHeader(" ,#text_filter");
sqlResultGrid.setInitWidths(“50,*”);
sqlResultGrid.setColAlign(“center,center”);
sqlResultGrid.setColTypes(“ch,ro”);

sqlResultGrid.enableAutoWidth(true);
sqlResultGrid.setSkin("dhx_skyblue");	
sqlResultGrid.init();

sqlResultGrid.enableSmartRendering(true);
sqlResultGrid.attachEvent("onXLS",function(start, count){

});
/*sqlResultGrid.attachEvent("onDynXLS",function(start, count){
	console.log("start: " + start + " count: " + count);
	
});*/
sqlResultGrid.attachEvent("onXLE", function(grid_obj,count){
	afterSqlResultsLoaded();
});

sqlResultGrid.loadXML("<?= site_url("visualSqlEditor/getDistinctResults/".$columnIndex."/")?>"); 

[/code]

as you are using the dynamic loading of data in your xml the total_count attribute is defined. So it shows the total number of rows. UNtil this number of rows is reached the grid will send the requests to load the “missing” data.
Please, try to set the total_count attribute to be equal to the actual number of records in your grid.