Hello, I'm having the following problem to implement the kendo grid:
This is my code in client side:
This is my code in client side:
$(document).ready(function () {
var dataSource = kendo.data.DataSource({
transport: {
read: {
url: '@Url.Action("GetAll", "Company")',
dataType:"json"
},
schema: {
data: "Companies",
total: "TotalCount",
model: {
id: 'CompanyID',
fields: {
CompanyID:{
type: 'number',
nullable: true,
editable:false
},
Name:{
type: 'string'
},
Rif:{
type: 'string'
},
Telephone:{
type: 'string'
},
FisicalAddress:{
type: 'string'
}
}
}
},
pageSize: 1
});
$("#grid").kendoGrid({
dataSource: dataSource,
height: 250,
scrollable: true,
sortable: true,
filterable: true,
pageable: {
input: false,
numeric: true
},
columns: [ { field: "CompanyID", title: "#", width: 150 },
{ field: "Name", title: "Name", width: 150 },
{ field: "Rif", width: 150 },
{ field: "Telephone", title: "Telephone"},
{ field: "FisicalAddress", width: 300 }]
});
});
and this is my code in server side:public JsonResult GetAll(
{
var companies = _companyService.GetAll().Select(c => new { c.CompanyID, c.Name, c.Rif, c.Telephone, c.FiscalAddress});
return Json(new { Companies = companies, TotalCount = companies.Count()},JsonRequestBehavior.AllowGet);
}
Error description in file kendo.web.min.js or kendo.data.min.js
Microsoft JScript runtime error: Object doesn't support property or method '_observe'
Any idea what may be happening? Thank you for help