1
我想根據jqGrid中的特定數據顯示/隱藏jqgrid刪除按鈕。顯示/隱藏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自己刪除選項,但自定義刪除其作爲下操作選項的代碼;
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行的字段數據條件上的刪除按鈕。例如,如果我得到行的字段值(成功,完整等),然後我想隱藏這個按鈕。我該怎麼做?請建議。