JqGrid のドキュメントには、postData に関して次のように記載されています。
サーバーに投稿されたデータにコンテンツを追加するために使用される配列
以上です。そのため、postData を使用して PHP に変数を送信し、switch ケースを使用して必要な関数を呼び出すことができるようにしています。
これにより、プロジェクトのすべての関数を含む単一の PHP ページを作成できます。同じことをしたいeditData
ので、プロジェクトに関連付けられたすべてのインライン編集機能に PHP ページは必要ありません。
ただし、editData
PHP ページに渡されていないようです。POSTされた変数をファイルに出力しようとしましたが、それらは空でした。提案?
注: 私は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'
});