Get DataTable settings
Get DataTable settings
modman
Posts: 2Questions: 0Answers: 0
Hello, I'm having problems find out how to get settings of some datatable. I have
[code]
$dt = dataTable({ ... })
[/code]
I did figure out that I can use this hack
[code]
$dt.DataTable.settings[0]
[/code]
but it's of course not working if I'm adding tables dynamically.
I need to get this, so I can get mData name for cell that I click on
[code]
$vc.on('click', 'td', function(){
var cell_name = $dt
.DataTable.settings[0]
.aoColumns[$dt.fnGetPosition( this )[2]] // as I'm dynamically hiding columns, I get original position of column
.mData
[/code]
Is there any way to get settings for $dt or get mData for td clicked from existing API outside of datatable module?
[code]
$dt = dataTable({ ... })
[/code]
I did figure out that I can use this hack
[code]
$dt.DataTable.settings[0]
[/code]
but it's of course not working if I'm adding tables dynamically.
I need to get this, so I can get mData name for cell that I click on
[code]
$vc.on('click', 'td', function(){
var cell_name = $dt
.DataTable.settings[0]
.aoColumns[$dt.fnGetPosition( this )[2]] // as I'm dynamically hiding columns, I get original position of column
.mData
[/code]
Is there any way to get settings for $dt or get mData for td clicked from existing API outside of datatable module?
This discussion has been closed.
Replies
I should say that the settings object is considered to be private. Dynamically changing values in it absolutely is not supported (for example, you can't change mData as you need to change a bunch of getter and setter functions as well).
Allan