Bind the sorting event to another element

Bind the sorting event to another element

SiggerSigger Posts: 1Questions: 0Answers: 0
edited June 2011 in General
Hi there,

at first i have to say, that DataTables is an amazing piece of software and the documentation is really nice as well. Thank you for your good work and the possibility to use it.

The question I have may be is a bit newb-ish so sorry for that. But i just could not figure out a solution by reading the forum and other files.

I'd like to change the control for the sorting event, which is currently on the .

I use a table like this:




Title 1

Title 2



...


I want to have a column search in the table-headline, so i've placed a text-input inside of the .
The problem now is, that i can't focus the Input-box without triggering the sort function.

Is there a way to set the Sort-trigger to "thead th span"? It'll be great to have the event fired only by clicking on "Title1" or "Title2"

I have tried to change the "fnSortListener" but it doesn't quite seems to work for me.

Thank you very much

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    fnSortListener is indeed the function to use ( http://datatables.net/api#fnSortListener ) - remember to unbind the default sorting event handlers that DataTables adds automatically.

    Allan
This discussion has been closed.