Sorting Taking Place automatically When Input Drop-down Filters moved to header
Sorting Taking Place automatically When Input Drop-down Filters moved to header
Dear All,
I moved the input drop down from footer to header .Due to which sorting place for the column when ever I try to filter the column
Can anyone please do let me know what is the issue at below line ,Are is it possible to give sort based on column text.
column.data().unique().sort().each(function (d, j) {
select.append('<option value="' + d + '">' + d + '</option>')
});
This question has an accepted answers - jump to answer
Answers
Hi @beginner_2018 ,
Good to see it's all taking shape. It's not easy to have the ordering not affected by the sorting if they're on a single line. The best solution, as in this modification of your fiddle, is to have two header lines, one for the filter, and one for the sort.
Hope that works for you,
Cheers,
Colin
Tanks for your response Sir,
I had added data-orderable="false" for one of the THEAD, And filters are working fine ,But could you please help me how can I point the sort to another header or THEAD
I'm sorry, I don't understand that. You want the dropdown to contain values for another column?
This example uses search inputs but you should be able to do the same with a drop down search. It uses
orderCellsTop
to move the sorting event handlers to the top row.http://live.datatables.net/giharaka/1/edit
Kevin
Ah, I see, thanks Kevin, having a senior moment there. Yep, what he said.