We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

(Urgent) How to get filtered data for all pages on select all checkbox event

I want filtered data on click of select all checkbox for javascript grid.
I got either all data on headCheckChange event or records on currentView data but I want all filtered records which are present on all pages.
How to get it ..?

I have attached link for that:  http://jsplayground.syncfusion.com/a0rnnkmv

1 Reply

JK Jayaprakash Kamaraj Syncfusion Team February 3, 2016 01:51 PM UTC

Hi Gomtesh,
We have analyzed your requirement and achieved using datamanager executeQuery property. Please refer to the below code example, help documentation and sample.
Code Example:
  function headCheckChange(e) {
                $("#Grid .rowCheckbox").ejCheckBox({ "change": checkChange });
                gridObj = $("#Grid").data("ejGrid");
              console.log(gridObj);
                var pager = gridObj.model.pageSettings;
                if ($("#headchk").is(':checked')) {
                    $(".rowCheckbox").ejCheckBox({ "checked": true });
                    gridObj.multiSelectCtrlRequest = true;
                    gridObj.selectRows(0, pager.pageSize);
                                                                                // To Select all rows in Grid Content
                                                                                var queryClone=$.extend(true,{},gridObj.model.query)
                                                                                for( i=0;i<queryClone.queries.length;i++){
                                                                                if(gridObj.model.query.queries[i].fn == "onPage")
                                                                                delete gridObj.model.query.queries[i];
                                                                                gridObj.model.query.queries.length--;
                                                                                break;
                                                                                }
                                                                               
                var queryPromise = gridObj._dataSource().executeQuery(gridObj.model.query);
                                                                var proxy = gridObj;
                queryPromise.done(ej.proxy(function (e) {
                                                                var filterrecords = e.result;
                }));

Help Documentation: http://help.syncfusion.com/js/datamanager/query
Sample: http://jsplayground.syncfusion.com/5adiwrwh
Regards,
Jayaprakash K.

Loader.
Live Chat Icon For mobile
Up arrow icon