是否有任何特殊类应用于网格的 emptyText
?我试着用 Firebug 检查元素,只发现了这个:
<div id="gridview-1021" class="x-component x-grid-view x-fit-item x-component-default
x-unselectable" role="presentation" tabindex="-1" style="-moz-user-select: none; width: 398px; height: 150px;">
There are no items to show in this view.
</div>
似乎没有专门的类来识别 CSS 并将其应用于 emptyText
。有什么方法可以添加一个类,或者有什么特殊的方法来设置空文本的样式吗?
注意:
我这样做了,对我来说效果很好:
emptyText: '<div style="width:auto; text-align:center; padding-top:50px; color:red; font-weight:bold;">There are no items to show in this view.</div>'
最佳答案
columns:[{
header: 'columnName',
dataIndex: 'dataIndex',
renderer: function(value, metaData, record, rowIndex) {
if (value == '')
metaData.tdCls = 'emptyText';
}
}]
并且您应该定义 emptyText css 规则。此自定义呈现器应用于特定列
关于javascript - 如何将 css 应用于 extjs 网格空文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6876901/