ParamQuery grid support forum
General Category => ParamQuery Pro Evaluation Support => Topic started by: cmcooper on September 20, 2016, 07:50:26 pm
-
I have added an alert to the dataModel to cancel going to the next page and filtering if there is unsaved data in the grid.
beforeSend: function(jqXHR, settings){
if(pageHasChanges){
var answer = confirm("Unsaved changes will be lost!");
if(!answer){
grid.hideLoading();
return false;
}
}
Everything works correctly except the page number is still incremented even though the paging was canceled. Is there a way to stop the increment from happening?
-
I'm not clear in what kind of scenario you want to cancel remote paging and filtering together.
cancel paging is used in this example.
http://paramquery.com/pro/demos/editing
//check the changes in grid before navigating to another page or refresh data.
grid.pager().on("beforeChange beforeRefresh", function (evt, ui) {
if (grid.isDirty()) {
var ans = window.confirm("There are unsaved changes. Are you sure?");
if (!ans) {
return false;
}
}
});