Using oTable.fnOpen inside fnDrawCallback
Using oTable.fnOpen inside fnDrawCallback
andreydruz
Posts: 2Questions: 0Answers: 0
Hello,
I need to use oTable.fnOpen inside fnDrawCallback.
[code]
oTable = $(".dataTable").dataTable({
"fnDrawCallback": function (oSettings) {
oTable.fnOpen(this, "some text", 'details');
}
});
[/code]
How can I do it?
Thank's
Andrey.
I need to use oTable.fnOpen inside fnDrawCallback.
[code]
oTable = $(".dataTable").dataTable({
"fnDrawCallback": function (oSettings) {
oTable.fnOpen(this, "some text", 'details');
}
});
[/code]
How can I do it?
Thank's
Andrey.
This discussion has been closed.
Replies
[code]
oTable = $(".dataTable").dataTable({
...
"fnDrawCallback": function () {
var nTr = \$(".dataTable tbody tr"),
checked = \$('input:radio[name=reporttype]:checked').val(),
thisTable = \$('.dataTable').dataTable(); //<----- Instead of oTable
if (checked == 'closed') {
nTr.each(function() {
if (thisTable.fnIsOpen( this )) {
thisTable.fnClose( this );
}
}
} else { // Toggle is open
nTr.each(function() {
if (!thisTable.fnIsOpen( this )) {
thisTable.fnOpen( this );
}
}
}
});
[/code]
I'm toggling all hidden rows and need to make sure I'm closed or open when the table is refreshed.
[code]
oTable = $(".dataTable").dataTable({
"fnDrawCallback": function (oSettings) {
this.fnOpen(this, "some text", 'details');
}
});
[/code]
Allan