Using fnGetPosition on dynamic tables
Using fnGetPosition on dynamic tables
andrew.bishop
Posts: 6Questions: 0Answers: 0
Hi again. I was wondering about getting the position of a selected row in tables that are dynamically created with AJAX. The example shown for fnGetPosition would work for me if I had td's or tr's in the table body, but since Datatables is drawing the table from a datasource, there are none.
I'm hoping to create a hyperlink for the row. When a user clicks anywhere on a particular row, it will send them to another page (in my case, a "details" page)
Thanks for you help!
Andrew
I'm hoping to create a hyperlink for the row. When a user clicks anywhere on a particular row, it will send them to another page (in my case, a "details" page)
Thanks for you help!
Andrew
This discussion has been closed.
Replies
If I understand correctly, then you can certainly do what you are looking for - the key is added event handlers post initialisation: http://datatables.net/examples/example_events_post_init.html .
You can get all of the TRs (and subsequently the TDs) by using fnGetNodes(). From there fnGetPosition() should work perfectly.
Allan