JqGrid 文档说明了有关 postData 的以下内容:
用于向发布到服务器的数据添加内容的数组
就是这样。因此,我使用 postData 将变量发送到我的 PHP,以便我可以使用 switch case 来调用我想要的函数。
这允许我拥有一个包含项目所有功能的 PHP 页面。我想做同样的事情,editData
所以我不需要为与项目关联的每个内联编辑功能创建一个 PHP 页面。
但是,editData
似乎没有传递到 PHP 页面。我尝试将 POSTed 变量打印到文件中,但它们是空的。建议?
注意:我知道这个editData
错误,但这应该由我正在使用的版本 4.4.4 修复
$("#list").jqGrid({
url:'functions.php',
datatype:'xml',
mtype:'POST',
postData: {
action:'popGrid',
sqlCount:sqlCount,
sqlSelect:sqlSelect,
sqlSelect2:sqlSelect2,
label1:label1,
label2:label2,
},
colNames:['Label','Account_Num','Amount', 'Type Code', 'Record Code', 'Sequence'],
colModel :[
{name:'label', index:'label', width:150, align:'center', sortable:false, editable:true},
{name:'cntrct_id', index:'cntrct_id', width:150, align:'center', sortable:true},
{name:'amount', index:'amount', width:150, align:'center', sortable:false, editable:true},
{name:'type_cd', index:'type_cd', width:150, align:'center', sortable:false, editable:true},
{name:'rec_cd', index:'rec_cd', width:150, align:'center', sortable:false},
{name:'db_seq', index:'db_seq', width:150, align:'center', sortable:false},
],
editurl: 'functions.php',
extraparam: { action: function(){ return 'grdAdjust'; } },
onSelectRow: function(id) {
if(id && id!==lastSel) {
jQuery('#list').restoreRow(lastSel);
jQuery('#list').editRow(id,true);
lastSel=id;
}
},
pager: '#pager',
rowNum:100,
rowList:[100,200,300,400,500,600,700,800,900,1000],
sortname: 'cntrct_id',
sortorder: 'desc',
viewrecords: true,
caption: 'Adjustments'
});