首页 > 解决方案 > 剑道 ui 网格单元格空消息

问题描述

如果网格数据源中缺少单元格的数据,则输出为 undefined/null,具体取决于单元格类型 String/Number。我还没有找到为空单元格指定默认消息的方法。

字段:“标题”,

标题:“标题”,

模板:“#:单价#”,

noDataMessage: "noData...",

宽度:“自动”,

有没有办法为空单元格存储标准消息,例如 noDataMessage?

我的小示例代码:https ://dojo.telerik.com/AKInuYEG/2

数据集 Ikura 没有 UnitPrice,因此空单元格的输出为 null

标签: kendo-uikendo-ui-grid

解决方案


据我所知,没有像“NoDataMessage”这样的单元格/列配置,因此您应该检查模板中的属性是否为空:

template: "<div class=\'priceTempl\'>#: UnitPrice != null ?  UnitPrice : 'No data'#</div>"

推荐阅读