问题
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