需要jqgrid saverow相关的帮助

时间:2011-06-06 18:56:02

标签: javascript ajax jquery jqgrid

这是目前正在进行的网格

var lastsel;

grid.jqGrid({
url:'grid_data_loader.php,
datatype: 'json',
mtype: 'POST',
colNames:['ID','Date Created','Subject','Status','Location','Action'],
colModel :[ 
  {name:'id', index:'id', align:'center', hidden:true},
  {name:'date'}, 
  {name:'subject'},
  {name:'status',align:'center'},
  {name:'location',editable: true, align:'center', edittype:"select",

editoptions: { 
               dataUrl: 'control.php',
               dataEvents: [
                  {  type: 'change',
                     fn: function(e) {
                        grid.saveRow(lastsel,true);

                     }
                  }
               ]
}     


  },
  {name:'action'}
],
rowNum:10,
rowList:[10,20,30],
autowidth: true,
height: "100%", 
pager: '#pager',
sortname: 'id',
viewrecords: true,
rownumbers: true,
sortorder: "asc",
editurl: "control.php?case=8",
onSelectRow: function(id){
  if(id && id!==lastsel){
    grid.jqGrid('restoreRow',lastsel);
    grid.editRow(id,true);
    lastsel=id;
  }
}

});

一切正常但我无法确定如何在保存行后检查服务器响应

任何帮助都会很棒

由于

1 个答案:

答案 0 :(得分:0)

您可以使用saveRowaftersavefuncerrorfunc参数。