我正在使用ngx-datatable。如果列名中包含特殊字符和驼色字符,则排序不起作用。
例如 :
在表中,我需要对以下列进行排序:
- 显示名称
- 名
请问谁能给我解决方案?
谢谢并恭祝安康
希尔帕·库尔卡尼
我正在使用ngx-datatable。如果列名中包含特殊字符和驼色字符,则排序不起作用。
例如 :
在表中,我需要对以下列进行排序:
请问谁能给我解决方案?
谢谢并恭祝安康
希尔帕·库尔卡尼
抱歉,我还没有发表评论,我只是说说我的经验,我使用过这个网格,这很棒,但我迁移到 primeNG 是最好的解决方案,而且工作起来更灵活。
<ngx-datatable-column *ngFor="let col of columns" name="{{col.name}}" prop="{{col.prop}}" class='{{col.prop}}' [sortable]="false" [cellClass]="getCellClass">
<ng-template let-column="column" let-sort="sortFn" ngx-datatable-header-template>
<span class="datatable-header-cell draggable unselectable" (click)="onSort($event,col.prop, col.sortAscending = !col.sortAscending)" title="{{col.desc}}">
{{col.name}}
</span>
</ng-template>
</ngx-datatable-column>
public columns: Array<any> = [
{ name: 'Display Name', prop: 'displayName', sortAscending: false },
{ name: 'First Name', prop: 'first_name', sortAscending: false },
];
private onSort(event: any, column: string, sortingType: boolean) {
//here update the resilt rows as per assending or desc
}