如何在JQGrid中删除内联删除操作 [英] How to remove inline delete action in JQGrid

查看:100
本文介绍了如何在JQGrid中删除内联删除操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从该问题中修改示例自定义jQGrid发布操作 http://ok-soft-gmbh.com/jqGrid/TestSamle/Admin1. htm 删除这样的删除操作:

I was trying to modify the sample from that question Custom jQGrid post action http://ok-soft-gmbh.com/jqGrid/TestSamle/Admin1.htm to remove delete action like that:

ondblClickRow: function (id, ri, ci) {
                    //...
                    $("div.ui-inline-edit", tr).hide();
                    //...
                }, 

onSelectRow: function (id) {
                    //...
                        $("div.ui-inline-edit", tr).show();
                    //...
                    }



  loadComplete: function () {
      $("div.ui-inline-del", tr).hide();
    }

但没有帮助.

有什么想法我该怎么做?

Any ides how i can do that?

推荐答案

在我看来,您应该先隐藏loadComplete内的所有"del"图标,然后将afterSaveafterRestore属性添加到<actions格式程序的c3>:

It seems to me that you should first hide all "del" icons inside of loadComplete and then add afterSave and afterRestore property to the formatoptions of the actions formatter:

formatter: 'actions',
formatoptions: {
    keys: true, // we want use [Enter] key to save the row and [Esc] to cancel editing
    afterSave: hideDelIcon,
    afterRestore: hideDelIcon
}

其中

var hideDelIcon = function(rowid) {
        setTimeout(function() {
            $("tr#"+$.jgrid.jqID(rowid)+ " div.ui-inline-del").hide();
        },50);
    };

请在此处查看修改后的演示.

See the modified demo here.

这篇关于如何在JQGrid中删除内联删除操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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