{hero}

searchPanes.viewTotal

自:SearchPanes 1.0.0

搜索时更新计数列以显示可见计数。
请注意 - 此属性需要一个 SearchPanes扩展用于 DataTables。

描述

通过设置 searchPanes.viewTotal 参数为 true,当对 DataTable 应用搜索时,显示在计数列中的消息将发生更改。

按照标准的设置,当没有应用筛选时,SearchPanes 将设置显示列来显示在列中可见的不同值的数量。当筛选处于活动状态时,计数列将显示当前显示中满足此条件的记录,随后的括号内显示满足此条件的表中的记录总数。

这对于查看在搜索表后实际包含记录的选项非常有用。

可以通过使用 searchPanes.i18n.countsearchPanes.i18n.countFiltered 选项,调整在搜索进行中和未进行中显示的消息。仅当 searchPanes.viewtotal 设置为 true 时,才会显示 searchPanes.i18n.countFiltered 消息,否则,将仅显示 searchPanes.i18n.count

注意:通过 ajax 加载 SearchPanes 选项,但随后使用serverSide,则不支持searchPanes.viewTotalsearchPanes.cascadePanes。这是因为要求用户为 SearchPanes 选项提供准确的数据,使用这两个选项时这些数据的数值会发生变化。虽然仍然可以启用这些选项,但并不建议这样做,且可能会导致意外行为。

类型

布尔值

描述

通过将 searchPanes.viewTotal 设置为 true,当对表格应用搜索时,窗格中计数列中的消息将更改,以表示当前可见的记录。

默认

  • 值:false

对于 searchPanes.viewTotal 参数来说,默认值为 false

示例

启用 viewTotal

1
2
3
4
5
6
7
8
9
new DataTable('#myTable', {
    layout: {
        top1: {
            searchPanes: {
                viewTotal: true
            }
        }
    }
});

相关

以下选项直接相关,在应用开发中也可能有用。

Comments (0)

No comments posted for this page yet. Be the first to contribute!

Post new comment

Contributions in the form of tips, code snippets and suggestions for the above material are very welcome. To post a comment, please use the form below. Text is formatted by Markdown.

To post comments, please sign in to your DataTables account, or register:

Any questions posted here will be deleted without being published.
Please post questions in the Forums. Comments are moderated.