简体   繁体   中英

Kendo Mvc Treelist shows "No records available." after upgrading

I am using Kendo for Asp.Net MVC in my application. Recently I upgraded to version 2021.2.616 After that the treelist stopped showing data. Only "No records available." is shown树列表中没有数据

The ajax is returning data correctly.

There are no console errors or any other errors shown.

Some additional info:

This is the code that returns the data from action

IEnumerable<CategoryModel> result = ... linq query here ...;
return Json(result.ToTreeDataSourceResult(request,
                    e => e.Id,
                    e => e.ParentCategoryId,               
                    e => e                   
                    ));

The problem was with value of parent category - ie ParentCategoryId.

When using 2021.2.616 : For root - ie if there is no parent - the value should be 0 (zero). Null wont work.

The confusion was because in the previous Kendo version that we had (2019.x.xxx), this was not the case. It could either be null or zero. In my case the value was null.

So, I hope this answer helps those who are upgrading to newer versions of kendo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM