Angular Kendo Grid:将排序的过滤后的网格保存在变量中 [英] Angular Kendo Grid: Save Sorted Filtered Grid in a Variable

查看:133
本文介绍了Angular Kendo Grid:将排序的过滤后的网格保存在变量中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在制作一个网格,该网格是:可排序,可选,可过滤和列选择器等.

We are making a Grid which is: Sortable, Selectable, Filterable, and Column selector, etc.

Kendo Angular Grid API的功能是什么?

What is the property in API for Kendo Angular Grid which does this?

我们正尝试将经过过滤/排序的网格数据存储到与原始网格数据不同的变量中.

We are trying to store this filtered/sorted grid data into a variable, different from the Original Grid data.

这怎么办?

当前正在浏览资源; https://www.telerik.com/kendo-angular-ui/components/grid/api/

Currently looking through resource; https://www.telerik.com/kendo-angular-ui/components/grid/api/

<kendo-grid 
  [data]="documentPropertyGridData" 
  [resizable]="true" 
  [reorderable]="true" 
  [sortable]="true"
  >
  
  <kendo-grid-checkbox-column title="Select" [width]="10" [columnMenu]="false" [showSelectAll]="true">
  </kendo-grid-checkbox-column>

  <kendo-grid-column field="apn" title="APN" [width]="40">
    <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
      <div>{{dataItem?.apn}}</div>
    </ng-template>
  </kendo-grid-column>
  <kendo-grid-column field="propertyDescription" title="Property Description" [width]="70">
    <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
      <div>{{dataItem?.propertyDescription}}</div>
    </ng-template>
  </kendo-grid-column>
  <kendo-grid-column field="situsAddress" title="Situs Address" [width]="40">
    <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
      <div>{{dataItem?.situsAddress}}</div>
    </ng-template>
  </kendo-grid-column>
 
</kendo-grid>

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid

*实际表格将具有10-15个列过滤器,排序器和选择器等

*Actual table will have 10-15 Column Filters, Sorters, and selectors, etc

注意:放置答案,让我知道是否有更多最佳/更好的解决方案.似乎可行

Note: Placed answer, let me know if there is more optimal/better solution. It seems to work

推荐答案

我相信这可以在参考手册中保存数据.

I believe this would work in saving the data, within the reference manual

https://www. telerik.com/kendo-angular-ui/components/grid/how-to/persist-state/

import { process } from '@progress/kendo-data-query';

let newGridData = process(originalData, state).data

这篇关于Angular Kendo Grid:将排序的过滤后的网格保存在变量中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆