Manualy initialising datatables
Manualy initialising datatables
I currently have the following:
[code]
$(document).ready(function() {
// Initialise Table
objTable = $('#Data').dataTable( {
......................
[/code]
so that the table is built onload of the page.
what is the easiest way to "initialise" the table but not build the content until a form element is clicked on my page?
thanks.
[code]
$(document).ready(function() {
// Initialise Table
objTable = $('#Data').dataTable( {
......................
[/code]
so that the table is built onload of the page.
what is the easiest way to "initialise" the table but not build the content until a form element is clicked on my page?
thanks.
This discussion has been closed.
Replies
Allan
I have the datatables code within
$(document).ready(function() {
This initialises the table - in some cases I want the table to be drawn but no ajax request fired off until the user clicks a button
Having said that, it is possible to block the first XHR made by DataTables by using the fnServerData initialisation parameter and just putting in the logic that you want.
Allan
Can you expand on your last suggestion please? If I dont initialise the table onload I dont get any style etc (it looks nasty) so I'd like to (in the cases where I dont want the data loading immediately) load the table but have no data until a button is clicked.
Blocking the first XHR made sounds perfect
Allan