如何摆脱 PrimeNG 数据表中的“未找到记录消息"? [英] How to get rid of the 'No records found message' in PrimeNG datatable?
问题描述
我使用 PrimeNG 创建了一个数据表.我刚刚为数据表创建了 2 个标题.我实际上会从服务器获取数据,因此如果没有数据,我不希望显示默认的未找到记录"消息.
I created a data table using PrimeNG. I just created 2 headings for the datatable. I'll actually fetch the data from the server, hence if there is no data I do not want the default 'No records found message' to be shown.
如果表中没有数据,我希望该表为空.
I would like the table to be empty if there is no data in the table.
请看一下我在下面创建的表格:
Please take a look at the table that I have created below :
<p-dataTable>
<p-headerColumnGroup >
<p-row>
<p-column header="Weekday"></p-column>
<p-column header="Set Class Time"></p-column>
</p-row>
</p-headerColumnGroup>
</p-dataTable>
推荐答案
您可以使用 emptyMessage
属性来覆盖此消息:
You can use the emptyMessage
property to override this message :
<p-dataTable emptyMessage="">
...
</p-dataTable>
如果您不想看到边框,请使用 CSS 隐藏 ui-datatable-emptymessage
类.顺便说一句,在这种情况下,您不再需要使用 emptyMessage
属性.
Edit :
If you don't want to see the border, hide ui-datatable-emptymessage
class with CSS. Btw, you don't need to use emptyMessage
property anymore in that case.
.ui-datatable-emptymessage {
display:none;
}
这篇关于如何摆脱 PrimeNG 数据表中的“未找到记录消息"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!