2011-06-06 92 views
1

这是目前正在的jqGrid saverow相关帮助需要

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; 
    } 
} 

}); 

一切工作正常,但我想不出如何检查服务器响应行保存

任何帮助将是一个网格IM大

感谢

+0

这个问题可以帮助我回答一个关于如何在编辑后使用saveRow的问题。所以,谢谢:) 但是,你可以请张贴你的control.php文件吗?这真的会帮助我和其他人。 – 2013-02-06 14:58:51

回答

0

您可以使用saveRowaftersavefuncerrorfunc参数。