我正在使用ngx-datatable.如果列名中包含特殊字符和骆驼字符,则排序无法工作。
例如, :
在表中,需要对下列列进行排序:
有人能给我提供解决方案吗?
感谢并致以问候
希尔帕·库尔卡尼
发布于 2018-01-03 12:40:31
对不起,我还没有发表评论,我只是介绍了我的经验,我已经与这个网格工作过,这是很棒的,但我迁移到primeNG是最好的解决方案,更灵活的工作。
发布于 2018-05-23 10:56:45
<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
}https://stackoverflow.com/questions/48077408
复制相似问题