开发者

sending jsonreader parameters with ajax

How Can I send the jqgrid (jsonreader) parameters with ajax???

$.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',
        hei开发者_开发技巧ght: "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",
});


Use

data: { param1: 'value1', param2: 'value2' }

for the Ajax call.
jqGrid uses postData.

postData: { param1: 'value1', param2: 'value2' }


I used the (data:{}) with ajax but the jsonreader parameters is not sending .. when I use (postdata:{}) with jqgrid it's working OK, but I am having a problem when using the jQuery grid with dialog (load the grid in dialog) the dialog keep the old parameters, when I send another request it's not changing, that's why I want to use ajax, cause it's working, but I can't see the jasonreader parameters.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜