JQGRID从serializeCellData中的行返回所有单元格值

JQGRID从serializeCellData中的行返回所有单元格值,jqgrid,Jqgrid,我正在寻找一种方法,在用户每次编辑单元格时返回post元素中的所有行数据 目前我有 序列化CellData:函数(postdata) { postdata[site.csrf.keys.name]=site.csrf.name; postdata[site.csrf.keys.value]=site.csrf.value; postdata['po_id']=id_po; postdata['product_code']=$(“#order_details_grid”).jqGrid('getC

我正在寻找一种方法,在用户每次编辑单元格时返回post元素中的所有行数据

目前我有

序列化CellData:函数(postdata) { postdata[site.csrf.keys.name]=site.csrf.name; postdata[site.csrf.keys.value]=site.csrf.value; postdata['po_id']=id_po; postdata['product_code']=$(“#order_details_grid”).jqGrid('getCell',irowsel,'product_code'); postdata['description']=$(“#订单详细信息_网格”).jqGrid('getCell',irowsel,'description'); postdata['account_code']=$(“#order_details_grid”).jqGrid('getCell',irowsel,'account_code'); postdata['qty']=$(“#订单详细信息_网格”).jqGrid('getCell',irowsel,'qty'); postdata['price_each']=$(“#order_details_grid”).jqGrid('getCell',irowsel,'price_each'); postdata['gst_each']=$(“#订单_详情_网格”).jqGrid('getCell',irowsel,'gst_each'); postdata['price_-total']=$(“#订单_-details_-grid”).jqGrid('getCell',irowsel,'price_-total'); postdata['gst_-total']=$(“#订单_-details_-grid”).jqGrid('getCell',irowsel,'gst_-total'); 返回postdata; }, 而且它基本上是有效的。但是,我刚刚编辑的一个单元格返回为html

我可以将控制器更改为包含帖子名称和值,这样它就可以成为更通用的代码。但是在这个阶段,我只想传递每个值

代码不会被大量使用,因此性能在这一点上不是一个很大的考虑因素


有没有一种简单的方法可以在编辑而不是html时获取单元格的值?

我建议您在提交单元格之前使用
而不是
serializeCellData
来扩展信息,这些信息将发送到服务器。
beforeimitcell
的第一个参数是
rowid
,返回值应该是具有附加属性的对象。比如说,

beforeimitcell:函数(rowid){
返回$(this).jqGrid(“getRowData”,rowid);
}

此外,我建议您使用。从版本4.14.0开始,方法
getCell
getRowData
可以成功地从编辑单元格读取数据。

请在有关jqGrid的所有问题中包含有关jqGrid版本和jqGrid分支的信息(,商业版或Oleg版本中的旧jqGrid谢谢。我已经在免费使用jqGrid,但不是最新版本。