multi-column sorting with one column sorting by date (desc) and then by string but not by alpha
multi-column sorting with one column sorting by date (desc) and then by string but not by alpha
dataTable is a wonderful tool, but I'm not sure if what I'm trying to do is doable.
The issue I'm having is using the custom sort functions with "sType" and then using an "aTarget" on both table columns that it will affect. But how do I get both columns sent to the "sType" function?
Here is a synopsis of what I'm trying to do:
Need to sort a dataTable that has multiple dataTables on the page, but just need a specific table to do this functionality. This table will need to be sortable first by a date field descending order and then by a name string field. The String field will not be alphabetical, it will be a set format, like [Victoria, Albert, Stan, Gus], with any other name being sent in will fall after those in the order which they are sent.
So there can be more than one Victoria with different dates, like:
Victoria 2013/26/09
Albert 2013/26/09
George 2013/26/09
Victoria 2013/25/08
Albert 2013/25/08
Stan 2013/25/08
Bob 2013/25/08
Bob 2013/08/08
Let me know if I wasn't clear enough, and thanks!
The issue I'm having is using the custom sort functions with "sType" and then using an "aTarget" on both table columns that it will affect. But how do I get both columns sent to the "sType" function?
Here is a synopsis of what I'm trying to do:
Need to sort a dataTable that has multiple dataTables on the page, but just need a specific table to do this functionality. This table will need to be sortable first by a date field descending order and then by a name string field. The String field will not be alphabetical, it will be a set format, like [Victoria, Albert, Stan, Gus], with any other name being sent in will fall after those in the order which they are sent.
So there can be more than one Victoria with different dates, like:
Victoria 2013/26/09
Albert 2013/26/09
George 2013/26/09
Victoria 2013/25/08
Albert 2013/25/08
Stan 2013/25/08
Bob 2013/25/08
Bob 2013/08/08
Let me know if I wasn't clear enough, and thanks!
This discussion has been closed.
Replies
If I understand correctly, all columns are correctly sorting individually, but you want to tie multiple columns to sort together? You'd use aDataSort for that.
Allan