i want to add search and sorting with datatable head is it possible??

i want to add search and sorting with datatable head is it possible??

jatin gajerajatin gajera Posts: 60Questions: 23Answers: 0

i want to add individual search in column head when user press head text create input box and search and beside this box i want to add sorting functionality...is it possible.?? if yes then how......?

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    Yes but I would not recommend it. You are changing the behavior of the click event when a user clicks on a column header to sort and resort the columns.

    Just create a second header row with input boxes

  • jatin gajerajatin gajera Posts: 60Questions: 23Answers: 0

    bindrid If you know please explain...

    i want to know how it's possibal??

  • jvretamerojvretamero Posts: 26Questions: 0Answers: 3

    I agree with @bindrid, changing the click behaviour is bad to user experience.

    But @jatin gajera what about this example?

  • jatin gajerajatin gajera Posts: 60Questions: 23Answers: 0

    i try to make both event in one table header like when user click on column's head create text box and that text box provide search functionality and beside this text box sorting functionality also work that's good experince for user . i try many times but not get success.
    sorting functionality apply full head td tag so when i click colum's head text box create but sorting also done that's not good for user.
    if any one have ans please post it.

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    basically, you will have to take off the default handler and add your own that checks to see if the click is for sorting or searching. I did sort of an outline here: http://jsbin.com/socitiy/edit?js,output

  • jatin gajerajatin gajera Posts: 60Questions: 23Answers: 0

    yes Bindrid i see your demo but when i click table's column head part it's alert only sorting option not pop on search option so how can we differentiate click ? it's for searching and other for sorting...r u understand what i am saying??

    it's not work only sorting is work.

  • jatin gajerajatin gajera Posts: 60Questions: 23Answers: 0

    @allan please interfair in this question...

This discussion has been closed.