显示/隐藏jqgrid删除按钮 [英] show/hide jqgrid delete button

查看:286
本文介绍了显示/隐藏jqgrid删除按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想基于jqGrid中的特定数据显示/隐藏jqgrid删除按钮.

I want to show/hide jqgrid delete button on the basis of specific data in jqGrid.

 $('#jqgFlagger').jqGrid('navGrid', '#jqgpFlagger',
            { add: false, del: false, edit: false, search: false },
            { width: 'auto', url: '/DtlmTransaction/UpdateRole' },
            { width: 'auto', url: '/DtlmTransaction/InsertRole' },
            { width: 'auto', url: '/DtlmTransaction/DeleteMultiple' });

上面的代码表明我没有使用jqgrid自己的delete选项,而是使用下面的操作中的自定义delete选项;

Above is the code that shows that I'm not using jqgrid own delete option but the custom delete option from the action which is as under;

 colModel: [
                    { name: 'FlaggerName', resizable: false, index: 'FlaggerName', align: 'left', width: 312, editable: false },
                    { name: 'DataFileReceived', formatter: DataFileReceivedFormatter, resizable: false, index: 'DataFileReceived', width: 130, align: 'left', search: false, edittype: 'text' },
                    { name: 'ProcessStartDate', formatter: ProcessStartDateFormatter, resizable: false, index: 'ProcessStartDate', width: 130, align: 'left', align: 'left', search: false, edittype: 'text' },
                    { name: 'ProcessCompleteDate', formatter: ProcessCompleteDateFormatter, resizable: false, index: 'ProcessCompleteDate', width: 150, align: 'left', search: false, edittype: 'text' },
                    { name: 'Total', resizable: false, index: 'Total', width: 53, align: 'center', search: false },
                    { name: 'Identical', resizable: false, index: 'Identical', width: 53, align: 'center', search: false },
                    { name: 'Differences', resizable: false, index: 'Differences', width: 51, align: 'center', search: false },
                    { name: 'StateAbri', resizable: false, index: 'StateId', width: 48, align: 'left' },
                    { name: 'CountyName', resizable: false, index: 'CountyName', width: 86, align: 'left' },
                    { name: 'Name', resizable: false, index: 'ServiceName', align: 'left', width: 127 },
                    { name: 'StatusName', formatter: statusFormatter, resizable: false, index: 'StatusId', align: 'center', width: 70, search: false },
                    { name: 'StatusColor', hidden: true, resizable: false, index: 'StatusColor', align: 'left', width: 70, search: false },
                    { name: 'bitDefault', formatter: bitDefaultFormatter, resizable: false, index: 'bitDefault', align: 'left', width: 40, search: false, editoptions: { value: '1:0' }, editable: false, edittype: 'checkbox' },
                    { name: 'Names', resizable: false, index: 'Names', align: 'left', width: 100,
                        search: false, sortable: false, formatter: editFmatter
                    },
                    { name: 'act', index: 'act', width: 50, align: 'center', sortable: false, formatter: 'actions',
                        formatoptions: {
                            keys: true,
                            editformbutton: false,
                            delbutton: true,
                            editbutton: false,
                            delOptions: { url: '/DtlmTransaction/DeleteMultiple' }
                        }
                    }],

在这里您可以看到实际上我已经启用了delButton:true.现在我想在jqgrid行的字段数据条件上显示/隐藏删除按钮.例如,如果我获取行的字段值(成功,完成等),那么我想隐藏此按钮.我该怎么做?请提出建议.

Here you can see that in action i've enable delButton:true. Now i want to show/hide delete button on the jqgrid row's field data condtion. For example if i get the row's field value (success,complete, etc) then i want to hide this button. How can i do it? Please suggest.

推荐答案

查看演示来自另一个

Look at the demo from the answer. One more option is to disable navigator buttons based on the selected row like it shows in the demo from another old answer.

这篇关于显示/隐藏jqgrid删除按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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