dma_k
dma_k
dma_k
Posts: 18Questions: 3Answers: 0
Suppose I would like to add the support for column header tooltips to DataTables. For that I pass tooltip
column setting to DataTables constructor:
myTable = $("table#report").DataTable({
"data" : reports,
"columns" : [{
"title" : "ID",
"tooltip" : "Report ID",
"data" : "id"
}, {
"title" : "Comment",
"tooltip" : "Report comment",
"data" : "comment"
}],
...
});
Now what API can I use to access these extra values? I tried to do this via settings()
but I failed. I did it like this:
$(myTable.table().header()).find('th').each(function(index) {
$(this).attr('title', myTable.context[0].aoColumns[index].tooltip);
});
but I don't like accessing context
directly. What could be the better solution? Thanks for any hint in advance,
P.S. I have found this post but it does not provide any nice solution.
This discussion has been closed.