jqgrid--api,官网demo,编辑

api参考:

http://blog.csdn.net/hurryjiang/article/details/7551477

官网demo:

http://www.trirand.com/blog/jqgrid/jqgrid.html

对单元格进入编辑状态:

1 在colModel中加入三个参数:

editable : true,
edittype : "checkbox",
editoptions : {
value : "运行:停止"
}

2 监听select事件(onSelectRow),事件触发后,执行下面的代码:

//把当前选中的行,打开编辑状态(id:rowid,;true:启动键盘事件-->>enter:确认修改。esc:不做修改,直接返回)

chart.gridObj.editRow(id, true);

jqgrid中的编辑,还原以及保存方法如下:

//编辑
//$("#test").editRow(id, true);
//还原
//$("#test").restoreRow(id);
//保存
//$("#test").saveRow(id);
//});

jqgrid的编辑状态,可参考:

http://blog.csdn.net/mengtianyalll/article/details/13510311

http://blog.csdn.net/seng3018/article/details/7224476

原文地址:https://www.cnblogs.com/simonbaker/p/4227010.html