如何在JQGrid中删除内联删除操作

时间:2011-07-13 08:32:01

标签: jqgrid

我试图修改该问题的样本Custom jQGrid post action http://ok-soft-gmbh.com/jqGrid/TestSamle/Admin1.htm删除删除操作:

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();
    }

但没有帮助。

任何想法我怎么能这样做?

3 个答案:

答案 0 :(得分:12)

formatoptions怎么样:{...,delbutton:false,...}?

http://www.trirand.net/documentation/php/_2v70wa4jv.htm

答案 1 :(得分:1)

你可以加上这个:

 $('.ui-inline-del').each(function(index) {
                        $(this).html('');
                        });
or this:
$('.ui-inline-del').each(function(index) {
                    $(this).hide();
                    });

loadComplete: function () {的末尾 也改变了

.jqGrid('navGrid', '#Pager1', { add: true, edit: false }, {}, {},
                  myDelOptions, { multipleSearch: true, overlay: false });

为:

.jqGrid('navGrid', '#Pager1', { add: true, edit: false, del:false }, {}, {},
                  myDelOptions, { multipleSearch: true, overlay: false });

如果您想删除页脚中的行删除选项

答案 2 :(得分:1)

在我看来,您应首先隐藏loadComplete内的所有“del”图标,然后将afterSaveafterRestore属性添加到formatoptions actions 1}}格式化程序:

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);
    };

请参阅修改过的演示here

相关问题