Sorting of Search Panes
Sorting of Search Panes
Hi!
Is there any possibility, to sort my SearchSelect-List ?
My Site: https://p582810.webspaceconfig.de/suche-dynamic
Use the standard-values, to look the datatable
I have in my datatable a column with age-classes (AKL), they are called e.g. "U07-1" for People af age 6, or "U19-2" for people of age 17. These names are part of the nomenclature of the customer. Now this list is sorted alphabetical, but i want to sort this list by myself.
Is there any possibility?
Thanks for your answer - and excuse my english!
Hubert
Answers
That's good English, far better than my German!
To do this, you would use orthogonal data - this example here demonstrates that. You'll see the "Rarity" column is a string, but a number is returned within
columns.render
to ensure they're ordered appropriately.Colin
Hi Colin!
Thanks for your post!
I've understand the idea behind, but it doesn't work. I have made an example with 100 datasets: Example-Link As you can see, is works not correctly. The column "AKL" does not sort the datasets in the given order.
Or have I done anything wrong?
Bye
Hubert
Its hard to visualize the problem so I copied your switch block to show the orthogonal data generated for the
display
type. Sort the AKL column and you will see the last 3 rows are:The Datatables type detection has set the column type to string. When sorting string
2
does come after19
. You need to havecolumns.render
set the type to the data type you are returning or the sort operation. Changeif (type === 'sort') {
toif (type === 'sort' || type === 'type') {
. Toggle the comment of these 2 statements in the example to see that sorting is now working.http://live.datatables.net/memikati/1/edit
Kevin
Hi Kevin!
Thank you very much! Now it works!
That was the last step to the right solution!
Have a nice day - greetings from Brazil
Hubert