How to set the order of dropdown menu with cascading columns
How to set the order of dropdown menu with cascading columns
I am using Datatables with cascading dropdown. The values are automatically filled from the table. Is there a way I can set the order of the "Name" dropdown menu. In my example, the Name column has Ashton, Garrett and Test (listed alphabetically).
Is there a way I can change the order for this so that Garrett comes first, then Test and then Ashton? My first column will always have limited entries. This will not change. Should I set it manually? But I am not sure how the rest of the column values will react. I want rest of the columns to pull values automatically from the table.
Here is my example. - https://live.datatables.net/yamifera/8/edit
This question has an accepted answers - jump to answer
Answers
Please use this example instead - https://live.datatables.net/yamifera/9/edit
some things are broken in the previous example.
Use
column().index()
to get the column index. Use an if statement to check the index and execute the desired code based on the index. For example:https://live.datatables.net/yamifera/10/edit
Kevin
This is what I need. Thankyou very much!