ngx-datatable排序图标

  1. 給ngx-datatable设置css属性
/deep/ .ngx-datatable{
    .sortable .sort-btn:before {
        font-family: data-table;
        content: "c";
    }
    .sortable .sort-btn.datatable-icon-down:before {
        content: "f";
    }
    .sortable .sort-btn.datatable-icon-up:before {
        content: "e";
    }
}
  1. 如果某一列不需要排序,则可设置sortable为false

    
        
            {{value}}
        
    

  1. 检索条件重置的时候重置Icon和排序
@ViewChild('datatable') datatable: DatatableComponent;
this.datatable.sorts = [];

你可能感兴趣的:(ngx-datatable排序图标)