While loading the grid, getting Object doesn't support this property or method
please find below for code,
aspx:
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: {
transport: {
read: function (options) {
$.ajax({
type: "POST",
url: "Default.aspx/GetEvents",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
options.success(msg.d);
}
});
}
},
schema: {
model: {
fields: {
FirstName: { type: "string" },
LastName: { type: "string" },
City: { type: "string" }
}
}
},
pageSize: 10
},
height: 250,
scrollable: true,
sortable: true,
filterable: true,
pageable: true,
columns: [
{
field: "LastName",
title: "LastName",
width: 100
},
{
field: "FirstName",
title: "FirstName",
width: 100
},
{
field: "City",
title: "City",
width: 100
},
{
field: "Age",
title: "Age",
width: 100
}
]
});
});
Web method :
[WebMethod()]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static string GetEvents()
{
EventsOrg obj = new EventsOrg { FirstName = "Test", LastName = "11/22/1234", City = "tst", Age = "10" };
List<EventsOrg> objEvent = new List<EventsOrg>();
objEvent.Add(obj);
EventsOrg obj1 = new EventsOrg { FirstName = "Test 1", LastName = "1/12/1993", City = "tst 1", Age = "10" };
objEvent.Add(obj1);
JavaScriptSerializer js = new JavaScriptSerializer();
string strJSON = js.Serialize(objEvent);
return strJSON;
// return new JavaScriptSerializer().Serialize(objEvent);
// return objEvent;
}
refrences JS :
<link href="styles/examples-offline.css" rel="stylesheet" />
<link href="styles/kendo.common.min.css" rel="stylesheet" />
<link href="styles/kendo.default.min.css" rel="stylesheet" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/kendo.web.min.js" type="text/javascript"></script>
<script src="js/console.js" type="text/javascript"></script>
<script src="js/jquery-1.4.1.js" type="text/javascript"></script>
Please help me to identify the error for application
please find below for code,
aspx:
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: {
transport: {
read: function (options) {
$.ajax({
type: "POST",
url: "Default.aspx/GetEvents",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
options.success(msg.d);
}
});
}
},
schema: {
model: {
fields: {
FirstName: { type: "string" },
LastName: { type: "string" },
City: { type: "string" }
}
}
},
pageSize: 10
},
height: 250,
scrollable: true,
sortable: true,
filterable: true,
pageable: true,
columns: [
{
field: "LastName",
title: "LastName",
width: 100
},
{
field: "FirstName",
title: "FirstName",
width: 100
},
{
field: "City",
title: "City",
width: 100
},
{
field: "Age",
title: "Age",
width: 100
}
]
});
});
Web method :
[WebMethod()]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static string GetEvents()
{
EventsOrg obj = new EventsOrg { FirstName = "Test", LastName = "11/22/1234", City = "tst", Age = "10" };
List<EventsOrg> objEvent = new List<EventsOrg>();
objEvent.Add(obj);
EventsOrg obj1 = new EventsOrg { FirstName = "Test 1", LastName = "1/12/1993", City = "tst 1", Age = "10" };
objEvent.Add(obj1);
JavaScriptSerializer js = new JavaScriptSerializer();
string strJSON = js.Serialize(objEvent);
return strJSON;
// return new JavaScriptSerializer().Serialize(objEvent);
// return objEvent;
}
refrences JS :
<link href="styles/examples-offline.css" rel="stylesheet" />
<link href="styles/kendo.common.min.css" rel="stylesheet" />
<link href="styles/kendo.default.min.css" rel="stylesheet" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/kendo.web.min.js" type="text/javascript"></script>
<script src="js/console.js" type="text/javascript"></script>
<script src="js/jquery-1.4.1.js" type="text/javascript"></script>
Please help me to identify the error for application