Hi
i'm using a Kendo UI Grid (Version: 2014.2.716.545) within a ASP .NET MVC 5 Project to bind XML Data from a local hosted REST Webservice. I would like to "activate" ServerPaging. Here is my Datasource Definition
and my Controller Method:
The client calls the Controller Method correctly, but the request Parameter is always NULL. Is something wrong with my Client Definition ?
i'm using a Kendo UI Grid (Version: 2014.2.716.545) within a ASP .NET MVC 5 Project to bind XML Data from a local hosted REST Webservice. I would like to "activate" ServerPaging. Here is my Datasource Definition
var dataSource = new kendo.data.DataSource({
serverPaging: true,
serverFiltering: true,
serverSorting: true,
transport: {
read: function (options) {
$.ajax({
url: ".../api/{Controller}/GetData",
type: "POST",
success: function (data) {
options.success(data);
},
error: function (errorThrown) {
alert(errorThrown);
}
});
},
create: function (options) {
SaveData(options);
},
update: function (options) {
SaveData(options);
},
},
schema: {
type: "xml",
data: "/ArrayOfType/Type",
model: {
id: "Type_ID",
fields: {
Type_ID: {
field: "Type_ID/text()", type: "number",
validation: { required: true }
},
FieldA: {
field: "FieldA/text()", type: "string",
validation: {
required: true,
min: 1
}
},
FieldB: {
field: "FieldB/text()", type: "string",
}
}
}
},
pageSize: 50
});
and my Controller Method:
[System.Web.Http.ActionName("GetData")]
[System.Web.Http.HttpPost]
public ResponseMessageResult GetData([DataSourceRequest] DataSourceRequest request)
{
try
{
var list = _db.Load().ToDataSourceResult(request);
var resp = ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new ObjectContent<
DataSourceRequest
>(list, new System.Net.Http.Formatting.XmlMediaTypeFormatter
{
UseXmlSerializer = true
})
});
resp.Response.Headers.Add("Access-Control-Allow-Origin", "*");
return resp;
}
catch (Exception ex)
{
Logger.LogError(ex);
throw;
}
}
The client calls the Controller Method correctly, but the request Parameter is always NULL. Is something wrong with my Client Definition ?