Topic: Table Editor - Disable Sorting
ammi pro asked 1 year ago
I use example from your documentation, but [disableSort] does not work. All columns are still sortable. Also, is it possible to disable/enable sorting for a table in typescript?
<thead class="datatable-header">
<tr>
<th
*ngFor="let header of headers"
[mdbTableSortHeader]="header.field"
[disableSort]="header.disableSort"
scope="col"
>
{{ header.label | titlecase }}
</th>
<th scope="col">Actions</th>
</tr>
</thead>
headers = [
{ label: 'Company', field: 'company', disableSort: false },
{ label: 'Address', field: 'address', disableSort: true },
{ label: 'Employees', field: 'employees', disableSort: true },
];
Arkadiusz Idzikowski staff answered 1 year ago
It seems that by mistake we published updated code examples that use new features added in version 4.1.0. This version is now available, please try to upgrade your MDB5 Angular dependency to v4.1.0.
We suggest using the disableSort
input to disable/enable sorting because we update the state of many HTML elements depending on this parameter. You should be able to control this value in your Typescript code.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: MDB5 4.0.0
- Device: Laptop
- Browser: Chrome
- OS: W10
- Provided sample code: No
- Provided link: No