ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: ronperkins on January 13, 2016, 03:55:25 am

Title: Problem encountered using POST Parameters with Paging?
Post by: ronperkins on January 13, 2016, 03:55:25 am
If I do not pass any POST parameters as shown in the code below:

    var dataModel_brands = {
            location: "remote",
            dataType: "JSON",
            method: "POST",
            url: "/test_ajax.php",
            getData: function (dataJSON) {
                var data = dataJSON.data;
                return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: data };
            },
            sortIndx: ["name"]
        };


My Ajax class receives these POST parameters: pq_datatype=JSON&pq_curpage=1&pq_rpp=20

But if I pass my own POST parameters which are needed as shown in the code below:

     var dataModel_brands = {
            location: "remote",
            dataType: "JSON",
            method: "POST",
            getUrl: function() {
                return { url: "/test_ajax.php", data: {a : 'fetch_brands', usr : 'username'} };
            },
            getData: function (dataJSON) {
                var data = dataJSON.data;
                return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: data };
            },
            sortIndx: ["name"]
        };


My Ajax class only receives these POST parameters: a=fetch_brands&usr=username

For some reason the parameters needed for paging are not appended ?

Have I done something wrong or have I found a bug?

Thanks
Title: Re: Problem encountered using POST Parameters with Paging?
Post by: paramvir on January 13, 2016, 09:31:45 am
Any custom parameters should be added in dataModel.postData

http://paramquery.com/pro/api#option-dataModel-postData