How can i change table settings on the fly?
How can i change table settings on the fly?
Hi , i got the table located inside an iframe which is located inside my main page,
When I Click a button inside my main page i want to change the bLengthChange from false to true (for example)
But how do i get the table object and how can I modify it settings?
To find the table I can do this :
[code]
var oTable = $("#iframeMyTable").contents().find("#tasksTable")
[/code]
But can I cast it to dataTables? and how can i get the current value of bLengthChange and change it to a new value?
regards
Daniel.
When I Click a button inside my main page i want to change the bLengthChange from false to true (for example)
But how do i get the table object and how can I modify it settings?
To find the table I can do this :
[code]
var oTable = $("#iframeMyTable").contents().find("#tasksTable")
[/code]
But can I cast it to dataTables? and how can i get the current value of bLengthChange and change it to a new value?
regards
Daniel.
This discussion has been closed.
Replies
var oTable = $("#iframeMyTable").contents().find("#tasksTable").dataTable();
[/code]
should get you the original DataTables instance - assuming that the table has the tasksTable ID.
You can't change bLengthChange dynamically during run time of the table - only at initialisation. So two options: 1. reinitialise the table (use bDestroy:true as an option) or 2. simply hide the length change element.
Allan
but how can I hide/show the length element?
Allan