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);
}
}
}
/// 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);