我正在尋找一種方法來在用戶每次編輯單元時返回post元素中的所有行數據。JQGRID返回來自serializeCellData中的行的所有單元值
目前我有
serializeCellData: function(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'] = $("#order_details_grid").jqGrid('getCell',irowsel,'description');
postdata['account_code'] = $("#order_details_grid").jqGrid('getCell',irowsel,'account_code');
postdata['qty'] = $("#order_details_grid").jqGrid('getCell',irowsel,'qty');
postdata['price_each'] = $("#order_details_grid").jqGrid('getCell',irowsel,'price_each');
postdata['gst_each'] = $("#order_details_grid").jqGrid('getCell',irowsel,'gst_each');
postdata['price_total'] = $("#order_details_grid").jqGrid('getCell',irowsel,'price_total');
postdata['gst_total'] = $("#order_details_grid").jqGrid('getCell',irowsel,'gst_total');
return postdata;
},
,它主要是工作。然而,我剛剛編輯的一個單元格返回爲html。
我可以更改控制器以獲取帖子名稱以及值,因此它可以是更通用的代碼。然而在這個階段,我只想傳遞每一個價值。
該代碼將不會被使用很多,所以性能不是一個巨大的考慮在這一點上。
有沒有一種簡單的方法可以在編輯時獲取單元格的值而不是html?
請在所有關於jqGrid的問題中包含有關jqGrid版本和jqGrid([免費jqGrid](https://github.com/free-jqgrid/jqGrid),商業[Guriddo jqGrid JS] http://guriddo.net/?page_id=103334)或<= 4.7版本中的舊jqGrid),您可以使用它(可以使用)。 – Oleg