1.jqgrid當想增加一列時需要先卸載掉原先加載的colModel,然後在重新加載,卸載的語句爲:
$(“#gridTable”).GridUnload();
2.假設jqgrid的id是list,可以通過以下
(“#list”).jqGrid(“saveCell”,lastrow,lastcell); (“#list”).jqGrid(“restoreCell”,lastrow,lastcell);
保存或恢復就可以讓cell變爲非編輯狀態,lastrow和lastcell是最後點擊的那個cell的行和列全局變量,可以在beforeEditCell function中賦值
beforeEditCell:function(rowid,cellname,v,iRow,iCol){
lastrow = iRow;
lastcell = iCol;
}