kendo-ui - 剑道 ui 网格单元格空消息
问题描述
如果网格数据源中缺少单元格的数据,则输出为 undefined/null,具体取决于单元格类型 String/Number。我还没有找到为空单元格指定默认消息的方法。
字段:“标题”,
标题:“标题”,
模板:“#:单价#”,
noDataMessage: "noData...",
宽度:“自动”,
有没有办法为空单元格存储标准消息,例如 noDataMessage?
我的小示例代码:https ://dojo.telerik.com/AKInuYEG/2
数据集 Ikura 没有 UnitPrice,因此空单元格的输出为 null
解决方案
据我所知,没有像“NoDataMessage”这样的单元格/列配置,因此您应该检查模板中的属性是否为空:
template: "<div class=\'priceTempl\'>#: UnitPrice != null ? UnitPrice : 'No data'#</div>"
推荐阅读
- javascript - 使用动态 id 更改按钮的内部 HTML
- java - Service Builder 没有添加一些依赖项?
- wordpress - Wordpress - 将 url 查询字符串转换为永久链接
- python - Boto3 - 等到 AWS 数据库迁移任务被删除
- oracle - Oracle 数据库 Sql 开发人员
- angular - “组件”类型上不存在属性
- ruby - 如何使用单个命令创建特定数量的数组?
- amazon-redshift - 添加时间戳在红移中不起作用
- c - 如何使用 c 获取连接在同一网络中的机器的名称和 IP 地址?
- node.js - aws xray 采样不适用于 http 状态代码