How to redraw header without pulling ajax source again?
How to redraw header without pulling ajax source again?
HI,
I'm using dataTables with Jquery UI Tabs. The problem I have is my table is set as display:none initially by UI tab, so dataTables will not be able to calculate column width. I try to setup fnAdjustColumnSizing or fndraw on tab click event, they both works, but they both initiate an extra ajax call to request data from server side which isn't necessary in my case, fnAdjustColumnSizing even duplicate the data in my table.
Is there a way to redraw table header(recalculate column width) without requesting data from ajax source again?
Thanks.
I'm using dataTables with Jquery UI Tabs. The problem I have is my table is set as display:none initially by UI tab, so dataTables will not be able to calculate column width. I try to setup fnAdjustColumnSizing or fndraw on tab click event, they both works, but they both initiate an extra ajax call to request data from server side which isn't necessary in my case, fnAdjustColumnSizing even duplicate the data in my table.
Is there a way to redraw table header(recalculate column width) without requesting data from ajax source again?
Thanks.
This discussion has been closed.
Replies
Thanks!
Best,
Adam
Allan
[code]
// Create DataTable
var data_table = $(this.targ).dataTable(this.options);
// This method suspends ajax requests,
// makes a call to whatever goodness is desired: fnDraw, fnAdjustColumnSizing,
// then restores the previous setting
this.data_table.reDrawNoAjax = function() {
var ajax_data_get = this.dataTable.settings[0]['bAjaxDataGet'];
this.dataTable.settings[0]['bAjaxDataGet'] = false;
this.fnAdjustColumnSizing();
this.dataTable.settings[0]['bAjaxDataGet'] = ajax_data_get;
};
// Use the new method (perhaps as part of a resize callback)
data_table.reDrawNoAjax();
[/code]
Hope a real solution is added.
Thank You
[code]
oTable.fnAdjustColumnSizing(false);
[/code]
Pierrick