Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Post To .NET WebMethod ScriptMethod throws Javascript error

$
0
0
Hi,

The problem will occur because the schema is set to the transport options and so it will not be taken into account. The schema should be set to the dataSource options:
var dataSourceEntities = new kendo.data.DataSource({
    transport: {
        read: {
            type: "POST",
            url: app.apiUrl + "/GetEntities",
            contentType: "application/json; charset=utf-8",
            dataType: 'json'
        },
        parameterMap: function(options, operation) {
            return JSON.stringify(param);
        }
    },
    schema: {
        data: "d.Data", // ASMX services return JSON in the following format { "d": <result> }. Specify how to get the result.
        total: "d.Total",
        model: { // define the model of the data source. Required for validation and property types.
            id: "SelectOptionVM",
            fields: {
                text: {
                    type: "number"
                },
                value: {
                    type: "string"
                },
                selected: {
                    type: "boolean"
                }
            }
        }
    }
})


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>