Good day!
I am currently using a grid that utilizes a DataManager which fetches a defined amount of rows per page on a grid.
Currently what I am looking for is a way to create a custom event for the Grid's PagerModule wherein I can prevent the page from changing unless a Dialog is confirmed.
So basically, I just need a way to add a function that will control whether the page should start requesting from the DataManager.
Cheers!
|
var data = new ej.data.DataManager({
url: 'https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Orders',
adaptor: new ej.data.ODataAdaptor
});
var grid = new ej.grids.Grid({
dataSource: data,
allowPaging:true,
dataBound:Bound,
actionBegin:begin,
columns: [
. . .
]
});
grid.appendTo('#Grid');
function Bound(e){
var pager = document.getElementsByClassName('e-gridpager')[0].ej2_instances[0];
var old = pager.click;
pager.click = function (args) {
old.call(this, args);
// here you can add conditions
args.cancel = true; // cancels the pager refresh
};
}
function begin(e) {
if (e.requestType === 'paging') {
e.cancel = true; // cancels the grid paging
}
} |
|
var data = new ej.data.DataManager({
url: 'https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Orders',
adaptor: new ej.data.ODataAdaptor
});
var grid = new ej.grids.Grid({
dataSource: data,
allowPaging:true,
dataBound:Bound,
actionBegin:begin,
columns: [
. . .
]
});
grid.appendTo('#Grid');
function Bound(e){
var pager = document.getElementsByClassName('e-gridpager')[0].ej2_instances[0];
var old = pager.click;
pager.click = function (args) {
old.call(this, args);
// here you can add conditions
args.cancel = true; // cancels the pager refresh
};
}
function begin(e) {
if (e.requestType === 'paging') {
e.cancel = true; // cancels the grid paging
}
} |