Custom Sort Order for Filtered Results
Custom Sort Order for Filtered Results
Hello,
I have a table that includes first and last name under ONE column. I am being asked of the following and not sure how to implement it nor feel it is a worthy task.
When the user enters filtered text, the resulting searches should be sorted by those rows where the text occurs in the beginning of the first name should be ranked higher and shown at the top of the data result.
For example if I have the following names:
Aaron Kane
Akari Ono
Jack Anderson
Kate Smith
Kathy Jones
and I enter the following in the filter input box, "KA", the result set should be
KAte Smith
KAthy Jones
AKAri Ono
JacK Anderson
Aaron KAne
Thanks
I have a table that includes first and last name under ONE column. I am being asked of the following and not sure how to implement it nor feel it is a worthy task.
When the user enters filtered text, the resulting searches should be sorted by those rows where the text occurs in the beginning of the first name should be ranked higher and shown at the top of the data result.
For example if I have the following names:
Aaron Kane
Akari Ono
Jack Anderson
Kate Smith
Kathy Jones
and I enter the following in the filter input box, "KA", the result set should be
KAte Smith
KAthy Jones
AKAri Ono
JacK Anderson
Aaron KAne
Thanks
This discussion has been closed.
Replies
The solution can be found at http://datatables.net/plug-ins/sorting#Priority and using the "enum" example to create a priority sort. That worked but it does affect performance as I have more than 2200 rows with 6 columns of data and this is expected to grow.
What I am noticing is that I have to fnFilter and then fnSort to trigger my custom sort (implemented by a custom type). I notice the screen change during fnFilter but then the screen refreshes on fnSort and this is not acceptable.
Any suggestions?
Thanks
2200 rows is way too many rows to load, especially for complex filtering and sorting. You want to do that stuff on the backend on your SQL server.