如何使用内联插入获取jqgrid中新插入行的行ID

时间:2017-01-22 11:31:28

标签: jquery json free-jqgrid

我正在使用免费的jqgrid版本4.13并且我使用内联插入来插入新行,有没有办法获取插入行的id,所以我可以使用该id来获取行json对象。我也可以在输入键上调用保存事件,这样当我插入新行时,我就没有点击寻呼机上的保存按钮。

jQuery("#43rowed3").jqGrid({
    url:'server.php?q=2',
    datatype: "json",
    colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
    colModel:[
        {name:'id',index:'id', width:55},
        {name:'invdate',index:'invdate', width:90, editable:true},
        {name:'name',index:'name', width:100,editable:true},
        {name:'amount',index:'amount', width:80, align:"right",editable:true},
        {name:'tax',index:'tax', width:80, align:"right",editable:true},        
        {name:'total',index:'total', width:80,align:"right",editable:true},     
        {name:'note',index:'note', width:150, sortable:false,editable:true}     
    ],
    rowNum:10,
    rowList:[10,20,30],
    pager: '#p43rowed3',
    sortname: 'id',
    viewrecords: true,
    sortorder: "desc",
    editurl: "server.php",
    caption: "Using navigator"
});

jQuery("#43rowed3").jqGrid('navGrid',"#p43rowed3",{edit:false,add:false,del:false});
jQuery("#43rowed3").jqGrid('inlineNav',"#p43rowed3");

由于

0 个答案:

没有答案