Use multiple DataTables 1.9
Use multiple DataTables 1.9
Adrian2007
Posts: 19Questions: 7Answers: 0
Hello,
I would like to know how to select a DataTables in a page with 2 or more DataTables.
For example:
$('#tableList1').on( 'click', 'tbody tr', function () { //click on every row - this works
//do_something
});
$('#tableList1').on( 'click', 'thead tr th:not("#someid")', function () { //click on every cell of the header except the one with id=someid - doesn't work
//do something
});```
And then the same things for tableList2, tableList3, etc.
Thanx,
A
This discussion has been closed.
Answers
Not exactly clear what you are looking for. Here is a single event handler for multiple tables.
http://live.datatables.net/dozepotu/1/edit
Thank you for your rapid answer.
I actually need to select a DataTables (based on its ID) in order to make some operations (for example click on the columns header or rows) on one DataTables or on another one.
In my example I wanted to show that clicks on the body of every DataTables (identified by its ID) work but on the header not.