Angular Kendo Grid: Save Sorted Filtered Grid in a Variable

帅比萌擦擦* 提交于 2020-07-13 07:17:37

问题


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

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.

How can this be done?

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

*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


回答1:


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


来源:https://stackoverflow.com/questions/62785158/angular-kendo-grid-save-sorted-filtered-grid-in-a-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!