jqGrid阻止寻呼机导航? [英] jqGrid prevent pager navigation?

查看:115
本文介绍了jqGrid阻止寻呼机导航?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用自定义格式器来输出html表单文本框.如果用户输入了数据,然后单击了下一个/上一个按钮,我们想告诉他们您已经编辑了数据,单击确定以保留在该页面上并保存您的数据".你该怎么做?

We use a custom formatter to output html form text boxes. In the case that a user has entered in data and they hit the next/prev button, we want to tell them "you've edited data, hit ok to stay on this page and save your data". How can you do this?

使用以下命令时,会触发" onPaging "事件传呼机,但它似乎并不能阻止您进行分页.

The 'onPaging' event fires when you use the pager but it doesn't seem to let you prevent the pagination from occuring.

更新:当前解决方法:

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 :已记录错误的


Update 2: Bug logged here.

推荐答案

如果函数 onPaging 返回停止",则分页将被停止.

If the function onPaging returns 'stop' then the pagination will be stopped.

这篇关于jqGrid阻止寻呼机导航?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆