Custom Sort Order for Filtered Results

Custom Sort Order for Filtered Results

dotmundodotmundo Posts: 13Questions: 0Answers: 0
edited October 2012 in General
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

Replies

  • dotmundodotmundo Posts: 13Questions: 0Answers: 0
    Ok I found the solution although I find it awkward and it would nice to get feedback.

    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
  • TheSisbTheSisb Posts: 18Questions: 0Answers: 0
    edited October 2012
    Use pagination with pipelined loading maybe?
    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.
This discussion has been closed.