This is a migrated thread and some comments may be shown as answers.

parameterMap for Grid

2 Answers 851 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Georg
Top achievements
Rank 1
Georg asked on 09 Feb 2012, 05:19 PM
Hi,

I am playing with the grid to consume data from a webservice. The webservice accepts only json object. So I try the params "take=5&skip=0&page=1&pageSize=5" to convert to a json string with parameterMap, but this dosn't work. Are there any emxamples?

Cheers,
George

2 Answers, 1 is accepted

Sort by
0
Georg
Top achievements
Rank 1
answered on 10 Feb 2012, 04:12 PM
This is driving me mad.

var myPostData = {"pageSizer":5};
var myJsonString = JSON.stringify(myPostData);
var dataSource2 = new kendo.data.DataSource({
    transport: {
        read: {
            type: 'POST',
            url: "MyDataset.aspx/GetDataSet",
            dataType: "json",
            contentType: 'application/json; charset=utf-8',
            data: myJsonString,
            pageSize: 10,
            parameterMap: function(options) {return myJsonString}
        }
    },
    pageSize: 10,
    schema: {
        data: "d.data",
        count: "d.count.count"
    }
});

My Firebug show me: "take=100&skip=0&page=1&pageSize=100" but I need a Json string!

0
Atanas Korchev
Telerik team
answered on 10 Feb 2012, 04:18 PM
Hi,

 Here is an example which shows how to bind the grid using page methods: https://github.com/telerik/kendo-examples-asp-net/tree/master/grid-page-methods-crud 

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Georg
Top achievements
Rank 1
Answers by
Georg
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or