【发布时间】:2014-02-05 18:29:18
【问题描述】:
我正在使用 jqGrid 并设置了一个操作处理程序,我希望用户能够删除一行。正在调用 URL 中指定的回调,但我不知道如何将行 ID 传递给 URL 处理程序,因此我知道要删除哪一行。
谁有办法解决这个问题?
<script>
$( document ).ready(function() {
$("#list2").jqGrid({
url:'datahandler',
datatype: "json",
colNames:['Name','Description', 'Data (Abbreviated)', 'Actions'],
colModel:[
{name:'name',index:'name', width:300, resizeable:true},
{name:'description',index:'description', width:300, resizeable:true},
{name:'data',index:'data', width:600, resizeable:true},
{name : 'actions', sortable:false, index: 'actions', formatter:'actions',
formatoptions: {
keys: true,
editbutton: false,
delOptions: { url: 'deleterow' }
}}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager2',
sortname: 'name',
viewrecords: true,
sortorder: "desc",
caption:"PVSyst Data",
});
$("#list2").jqGrid('navGrid','#pager2',{edit:false,add:false,del:false});
});
</script>
【问题讨论】:
标签: javascript jquery jqgrid grid