jquery tabs and tabletools

jquery tabs and tabletools

Hi All,

I am using jquery 1.7.2 and TableTools 2.2.1 with DataTables 1.9.4

I have an issue with jquery tabs and tabletools being used together.
Some of my tabs are loaded via ajax call and some tab content is on the page itself which has the tabs initialized.

But I am not able to save as CSV/PDF when I click on the Tabletool buttons.

It works fine on the first tab , which is ajax loaded, but does not work on the tab content on other tabs of the page.

I used the folowing code to resize buttons but no result, it worked only if I have no ajax loaded tab.

$("#tabs").tabs({
            show: function(ui, event) {
                var ttInstances = TableTools.fnGetMasters();
                for (i in ttInstances) {
                alert(i);
                if (ttInstances[i].fnResizeRequired())
                    ttInstances[i].fnResizeButtons();
                }       
            }
});

Also, I observed that the alert(i) does come up when the page is loaded, but does not when I explicitly call it when that particualr tab is clicked( and I have datatables on this tab), code snippet below,
$("#tabs").tabs({
select: function(event,ui) {
            alert("tab no :"+ui.panel.id);
                switch (ui.panel.id) {
                case "tab_started":
                alert("hi here");
                var ttInstances = TableTools.fnGetMasters();
                for (i in ttInstances) {
                alert(i);
                if (ttInstances[i].fnResizeRequired())
                    ttInstances[i].fnResizeButtons();
                }       
            }
});

Any help is greatly appreciated. Please give any suggestions to solve this.