Grid cross-page selection issues

Just wondering if there’s a more efficient way to select all results across multiple pages in the Grid. I’m looking for a way to serialize an array to submit via POST across multiple pages since I’m dealing with larger datasets (4000+). SelectAll() only selects the first page, not the current active page which is strange, otherwise I’d iterate through the pages using mygrid.changePage(i); and run a SelectAll() on each. My code now does the same but uses selectRow which is quite slow vs this function and seems to only select ones in the buffer.

As is I’ve tried several methods all which seem to have some limit on the rows that have been loaded. Ideally I would use checkboxes where records could be selected using master_checkbox across all pages but this only seems to select the current page as well.

I feel like this is a common enough requirement, I have the code Posting and serializing fine it’s really just the cross page select all functionality that I need.

Here’s my config, any insight would be greatly appreciated!!

function SelectThemAll() {
//var total = mygrid.getRowsNum();
//var size = mygrid.rowsBufferOutSize;
//var rowsAll = mygrid.getAllRowIds();
var state=mygrid.getStateOfView();
var pageno=state[0];
for (var j=1; j<=pageno; j++){
mygrid.changePage(j);
var state=mygrid.getStateOfView();
var toprow=state[1];
var btmrow=state[2];
var numrows=state[3];
for (var i=toprow; i<btmrow; i++){
mygrid.selectRow(i,true,true,true);
}
}
}

Select All

/// HERE"S GRID JS
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath(“js/dhtmlxGrid/codebase/imgs/”)
mygrid.setColAlign(“center”);
mygrid.setHeader(“Sent SMS,Date,Source Number,Destination Number,Campaign,Link,Select”);
mygrid.attachHeader("#select_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#master_checkbox");
mygrid.setInitWidths(“70”);
mygrid.setColTypes(“ro,ro,ro,ro,ro,link,ch”);
mygrid.setColSorting(“int,date,int,int,int,int,int”);
mygrid.submitAddedRows(false);

mygrid.submitOnlySelected(true);
mygrid.submitOnlyRowID(true);
mygrid.enableMultiselect(true);
mygrid.enablePaging(true, 250, 25, "pagingArea", true, "recinfoArea");
mygrid.enableSmartRendering(false);
//SMART RENDER DOESNT WORK WITH PAGING 
//mygrid.enableDistributedParsing(true,500,500);
//mygrid.setAwaitedRowHeight(19); 

/*mygrid.forEachRow(function(id){ 
cellValue = mygrid.cells(id,1).getValue(); 
	if (cellValue == "0"){ 
	    mygrid.setRowColor(id,"#FFAFBA"); 
	} 
}); 
*/
//if (grid.currentPage == 1 ) 
//mygrid.groupBy(2);
mygrid.init();
mygrid.loadXML("js/connector/codebase/custom__connector.php");
var dp = new dataProcessor("js/connector/codebase/custom_connector.php");
dp.init(mygrid);

There is no other way to select all pages and serialize them. BTW it’s bad technique to serialize 4000+ row as it will hand the browser. If you want save changed from grid, it’s better to use DataProcessor. Please find more information here docs.dhtmlx.com/doku.php?id=dhtm … aprocessor

Thanks for your response - so there’s no way to select rows between pages? Since I’m not looking to modify row data I don’t think dataprocessor would work for us, I’m looking to pass an array of selected cells to php code so it can iterate through this array and perform an action. For example if I wanted to select 3000 rows (between two date ranges for instance) and export them what is the best way do do this?

Right now I’m running to the issue of:

  • smart-rendering not being able to properly select larger ranges since it skips the cells in between,
  • viewing 3000+ rows without stalls the browser so I have to use either paging or parsing now
  • enableDistributedParsing just delays the inevitable freeze as it loads more and more data
  • paging isn’t able to select the range across multiple pages as when I iterate through pages and use the selectRow function it only selects x amount of rows in the buffer and doesn’t select the whole range for some reason.

If there’s a better way to do this that I’m missing or if you have any code hints please let me know as this is a make or break feature for me

To select row in grid, appropriate row should be rendered. If you want select 3000 row, all those rows should be rendered which may decrease grid performance. We have experimental extension which can allow you select a lot of rows in case of Smart Rendering or Paging. If you interesting in it please contact support.dhtmlx.com/

Even in beta it’s worth a try, I’ve emailed support and am awaiting a response… thank you

Hello!

I’m using this code:

var ids = mygrid.getAllRowIds(); for (var id in ids) { mygrid.selectRow(id,true,true,true); }

Peter