爲什麼PostData值永遠不會發送到服務器?如果我用戶fixwed值POSTDATA:{測試:「3」}它的工作原理,但使用功能沒有被傳遞到服務器時..... 螢火蟲不露測試變量postData未發送到服務器jqgrid
$("#tblgrid").jqGrid({
datatype: 'json',
ajaxGridOptions: { contentType: "application/json" },
ajaxRowOptions: { contentType: "application/json", type: "POST" }, //row inline editing
serializeGridData: function(postData) { return JSON.stringify(postData); },
jsonReader: {
repeatitems: false,
id: "0",
cell: "",
root: function(obj) { return obj.d.rows; },
page: function(obj) { return obj.d.page; },
total: function(obj) { return obj.d.total; },
records: function(obj) { return obj.d.records; }
},
url: 'orthofixServices.asmx/GetProductList',
postData: { test: function() { return $("#tid").val(); } },
datatype: 'json',
colNames: ['id', 'Product Description', 'Commission Rate'],
colModel: [
{ name: 'id', width: 50 },
{ name: 'description', index: 'desc', width: 380, editable: true },
{ name: 'commissionrate', index: 'com', width: 120, editable: true, unformat: percentUnFormatter, formatter: percentFormatter, editrules: { number: true} }
],
serializeRowData: function(data) {
var params = new Object();
params.id = 0;
params.prdid = 4;
params.description = data.description;
params.commissionrate = data.commissionrate;
var result = JSON.stringify({ 'passformvalue': params, 'oper': data.oper, 'id': data.id });
return result;
},
mtype: "POST",
rowNum: 4,
width: 500,
height: 80,
pager: '#pager',
editurl: "orthofixServices.asmx/ModifyProductList"
});
$("#tblgrid").jqGrid('navGrid', '#pager', { add: false, edit: false, del: true }, {
//edit options
}, {
//add options
}, {
//delete options
的任何蹤跡});
我試圖做的是在這裏解釋說:http://stackoverflow.com/questions/2826478/jqgrid-not-updating-data-on-reload。所以postData似乎接受一個函數,它會在每次重新加載網格時動態更新 –