【发布时间】:2011-07-07 15:00:22
【问题描述】:
如何用ajax发送jqgrid(jsonreader)参数???
$.ajax({
url:'admin/report_table.php',
dataType: "json",
async: false,
success: function (data) {
if(!data) data=0;
// alert(data);
my_data = data;
}
});
jQuery("#report_data").jqGrid({
data: my_data,
datatype: 'local',
mtype: 'Get',
height: "auto",
width: 'auto',
rowNum: 20,
rownumbers: true,
rowList: [10,20,30],
colNames:['name','date'],
colModel :[
{name:'name', index:'name', width:100},
{name:'date', index:'date', width:150,align:"center"}],
pager: "#p_report_data",
viewrecords: true,
toolbar: [true, 'both'],
caption: "Report",
});
【问题讨论】: