gpt4 book ai didi

jquery - jqGrid 阻止寻呼机导航?

转载 作者:行者123 更新时间:2023-12-03 23:05:03 26 4
gpt4 key购买 nike

我们使用自定义格式化程序来输出 html 表单文本框。如果用户输入了数据并点击了下一个/上一个按钮,我们想告诉他们“您已经编辑了数据,点击确定以留在此页面并保存您的数据”。你怎么能做到这一点?

'onPaging ' 当您使用寻呼机时会触发事件,但它似乎无法阻止分页的发生。

<小时/>

更新:当前解决方法:

var currPg = 1;
var dirty = 'false';


$("#list").jqGrid({
...
onPaging: function (b) {
var nextPg = $("#list").getGridParam("page");

if (dirty == 'false') {
currPg = nextPg;
return;
}


$( "#dialog-confirm" ).dialog({
modal: true,
buttons: {
"Stay on current page": function() {
$( this ).dialog( "close" );
},
"Change page": function() {
$( this ).dialog( "close" );
reloadGrid($("#list"), null, nextPg, 'false');
}
}
});

$("#list").setGridParam({page:currPg}); //Workaround - jqGrid still increments the page num even when we return stop so we have to reset it (and track the current page num)
return 'stop';
},
<小时/>

更新 2:已记录错误 here .

最佳答案

如果函数 onPaging返回“stop”则分页将停止。

关于jquery - jqGrid 阻止寻呼机导航?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3805832/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com