【问题标题】:Syncfusion EJS-GRID ANGULARSyncfusion EJS-网格角
【发布时间】:2020-10-04 06:12:28
【问题描述】:

我想获取列过滤器前后的网格总行数。

angular9 中的同步融合 ejs-grid

请帮帮我。

【问题讨论】:

    标签: angular9 syncfusion


    【解决方案1】:

    根据您的查询,我们怀疑您希望在网格中显示总记录数。为了满足您的要求,我们使用了 EJ2 Grid 的聚合功能。聚合值显示在 Grid 的页脚、组页脚和组标题中,要在任何这些单元格中显示聚合值,请使用 footerTemplategroupFooterTemplate 和 groupCaptionTemplate属性。

    当我们在任何列中执行过滤时,聚合值将被更改。在下面的示例中,我们使用 Aggregate 功能在 Grid 组件的页脚中绑定了行计数详细信息

    请参考以下代码示例和示例了解更多信息。

    [app.component.html]

    <ejs-grid [dataSource]="data" [allowPaging]="true" allowFiltering="true" [pageSettings]='pageOption'> 
        <e-columns> 
            <e-column field='CustomerName' headerText='Customer Name' width='150'></e-column> 
            <e-column field='Freight' headerText='Freight' width='150' format='C2' textAlign='Right'></e-column> 
            <e-column field='OrderDate' headerText='Order Date' width='150' format="yMd" textAlign='Right'></e-column> 
            <e-column field='ShipCountry' headerText='Ship Country' width='150'></e-column> 
        </e-columns> 
    <e-aggregates> 
      <e-aggregate> 
        <e-columns> 
          <e-column columnName="CustomerName" type="Count"> 
            <ng-template #footerTemplate let-data>Rows Count: {{data.Count}}</ng-template> 
          </e-column> 
        </e-columns> 
      </e-aggregate> 
    </e-aggregates> 
    </ejs-grid> 
    

    sample

    帮助文档:

    doc- built-in-aggregate-types

    doc-footer-aggregate

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多