【发布时间】:2015-03-29 23:33:47
【问题描述】:
我正在尝试向 JqGrid 表添加新行,请求中发送的 json 被服务器接收。现在我正在尝试使用
向json添加新参数postData : {my_parameter: "my_id"}
但仍然没有发送my_parameter。
我也尝试过保留 mtype : "GET" ,但它仍然没有在 json 中发送我的自定义参数。
请你帮帮我。
提前致谢。
jQuery(grid_selector).jqGrid({
data: griddata,
datatype: "local",
height: "auto",
colNames:[' ', 'ID','Activity Name', 'Phase'],
colModel:[
{name:'myac',index:'', width:80, fixed:true, sortable:false, resize:false,
formatter:'actions',
formatoptions:{
keys:true,
//delbutton: false,//disable delete button
delOptions:{recreateForm: true, beforeShowForm:beforeDeleteCallback},
//editformbutton:true, editOptions:{recreateForm: true, beforeShowForm:beforeEditCallback}
}
},
{name:'id',index:'id', width:60, sorttype:"int", editable: true},
{name:'name',index:'name', width:150,editable: true,edittype:"select",editoptions:{value:activity_val}},
{name:'phase',index:'phase', width:90, editable: true,edittype:"select",editoptions:{value:"Phase1:Phase I;Phase2:Phase II;Other:Other"}},
],
viewrecords : true,
rowNum:20,
rowList:[10,20,30],
pager : pager_selector,
altRows: true,
gridview: true,
//toppager: true,
multiselect: false,
//multikey: "ctrlKey",
multiboxonly: true,
loadComplete : function() {
var table = this;
setTimeout(function(){
styleCheckbox(table);
updateActionIcons(table);
updatePagerIcons(table);
enableTooltips(table);
}, 0);
},
editurl: '/del_row/',//nothing is saved
cellEdit: true,
postData: {MyId :function() { return $('#MyId').val();}},
caption: "Activty Phase Mapping"
});
【问题讨论】:
标签: jquery html json django jqgrid