有谁知道如何在Kendo for Angular网格中设置默认排序字段?
<kendo-grid [data]="view | async"
[pageSize]="gridState.take"
[skip]="gridState.skip"
[sort]="gridState.sort"
[pageable]="{
buttonCount: 3,
info: true,
type: 'numeric',
pageSizes: true,
previousNext: true
}"
[sortable]="true"
(dataStateChange)="onStateChange($event)"
(edit)="editHandler($event)" (cancel)="cancelHandler($event)"
(save)="saveHandler($event)">
<kendo-grid-column field="Name" width="200" [editable]="false"></kendo-grid-column>
<kendo-grid-column field="Group" width="120" [editable]="false"></kendo-grid-column>
答案 0 :(得分:7)
尝试将gridState.sort属性设置为默认字段所需的值。
gridState.sort = [{ 'field': 'createdDate', 'dir': 'desc' }];
您可以设置声明它的属性。