Hello,
I use last version of kendo ui library with angularjs and asp.net mvc 5 on server.
If I use remote data binding kendo.all.js return Maximum call stack size exceeded error.
Whats wrong?
Thanks
controller:
public
class
TestController : Controller
{
[HttpGet, Route(
"category-tree"
)]
public
ActionResult TreeListCategories([DataSourceRequest] DataSourceRequest request)
{
var allCategories =
new
List<CategoryModel> {
new
CategoryModel {Id = 1, Name =
"First"
, ParentCategoryId =
null
},
new
CategoryModel {Id = 2, Name =
"Second"
, ParentCategoryId = 1},
new
CategoryModel {Id = 3, Name =
"Third"
, ParentCategoryId = 2},
new
CategoryModel {Id = 4, Name =
"Fourth"
, ParentCategoryId = 3},
};
var result = allCategories.ToTreeDataSourceResult(request);
return
Json(result, JsonRequestBehavior.AllowGet);
}
public
class
CategoryModel
{
public
int
? Id {
get
;
set
; }
public
string
Name {
get
;
set
; }
public
int
? ParentCategoryId {
get
;
set
; }
}
}
html code :
<
kendo-tree-list
k-options
=
"treelistOptions"
></
kendo-tree-list
>
angular js code :
$scope.treelistOptions = {
dataSource: {
type:
"aspnetmvc-ajax"
,
transport: {
read: {
type:
'GET'
,
url:
'category-tree'
,
}
},
schema: {
model: {
Id:
"categoryId"
,
ParentId:
"parentCategoryId"
,
fields: {
categoryId: { field:
"categoryId"
, type:
"number"
, nullable:
false
},
parentCategoryId: { field:
"parentCategoryId"
, nullable:
true
},
name: { field:
"name"
},}
}
}
},
columns: [
{ field:
"Name"
},
],
};