Kendo 将 Kendo UI 升级到版本 2020.1.406 后,MVC 网格在获取数据时显示 'no records found' 消息
Kendo Grid for MVC displays 'no records found' message while fetching data, after upgrading Kendo UI to version 2020.1.406
我下载了最新版本的KendoUI(版本:2020.1.406)用于MVC5,并升级了我的项目以引用最新的JS,CSS和Kendo.MVC (2020.1.406.545)。升级后,即使正在获取记录,网格也会显示 'no record found' 消息。
下面是 Kendo UI 的图像(版本:2020.1.406):
它在 Kendo UI 2018.2.516 上运行良好,如下所示:
我不想在获取记录时显示 'No record found' 消息,它应该只在完成获取数据并且没有记录存在时显示。
因为是KendoUI中的bug,所以不要使用grid的NoRecords方法。而是使用 DataBound 事件并调用下面的 JS 函数:
函数 onGridDataBound(e) {
如果 (!e.sender.dataSource.view().length) {
var colspan = e.sender.thead.find("th:visible").length, emptyRow = 'No Record Found.';
e.sender.tbody.parent().width(e.sender.thead.width()).end().html(emptyRow);
}
}
我下载了最新版本的KendoUI(版本:2020.1.406)用于MVC5,并升级了我的项目以引用最新的JS,CSS和Kendo.MVC (2020.1.406.545)。升级后,即使正在获取记录,网格也会显示 'no record found' 消息。
下面是 Kendo UI 的图像(版本:2020.1.406):
它在 Kendo UI 2018.2.516 上运行良好,如下所示:
我不想在获取记录时显示 'No record found' 消息,它应该只在完成获取数据并且没有记录存在时显示。
因为是KendoUI中的bug,所以不要使用grid的NoRecords方法。而是使用 DataBound 事件并调用下面的 JS 函数:
函数 onGridDataBound(e) { 如果 (!e.sender.dataSource.view().length) { var colspan = e.sender.thead.find("th:visible").length, emptyRow = 'No Record Found.'; e.sender.tbody.parent().width(e.sender.thead.width()).end().html(emptyRow); } }