Sorted Table: what is SortDirection.CONST in mdbTable?


Topic: Sorted Table: what is SortDirection.CONST in mdbTable?

Schermbecker asked 4 years ago

I recently worked with mdbTable and used the sorting functions. Since I did not find any hint in the documentation I'd like to ask, what "CONSTANT" means in this case?

declare enum SortDirection { ASC = "ascending", DESC = "descending", CONST = "constant" }

When clicking on a sorted table column it mostly works as expected (switching between "ASC" and "DESC") but sometimes the sorting event is declared as sortBy = "CONSTANT" and I have no idea what it is about.

Since I am indicating the current sort order using appropriate icons, I don't know how to handle the state "constant". Any help would be highly appreciated!


Arkadiusz Idzikowski staff commented 4 years ago

@Schermbecker This is a state in which sorted data is reset to its original form (ascending or descending sorting is not applied).


Schermbecker commented 4 years ago

@Arkadiusz Idzikowski Thank you.

How can I disable this? I really do not need it.

Another question: can I trigger the sorting after loading (unsorted) data from backend? In the documentation there is no hint about that. Or do I have to sort the data initially using typescript instead?


Arkadiusz Idzikowski staff commented 4 years ago

@Schermbecker Do you use resetSortDirection input? By default, it is set to false and the data should be sorted ASC/DESC unless you modify it.

Currently, there is no way to initialize sorting on component initialization.


Schermbecker commented 4 years ago

@Arkadiusz Idzikowski I will give it a try. Thank you so much for the fast reply!


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Open

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 10.1.1
  • Device: Desktop
  • Browser: Chrome 87
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No