1

After adding many tabs the plugin crashes. I'm using some plugins to enhance the tables inside the panels in my app. I don't know why but when i add the 3rd tab int the 2nd page the plugin doesn't activates the last added tab and that makes that the table plugin crashes.

This is some of my code:

int port = 18000;
DatagramSocket serverSocket = new DatagramSocket(port);
byte[] receiveData = new byte[8];
System.out.println("Server Listing on Port: "+port);
String x;
while (true)
{
    DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
    serverSocket.receive(receivePacket);

function addSearchResult(title, content) {
    id = "tabs-" + tabId.toUpperCase(),
    li="<li><a href='#"+id+"'>"+title.toUpperCase()+"</a><span class='ui-icon ui-icon-close'></span></li>";
    tabs.find( ".ui-tabs-nav" ).append( li );
    tabs.append( "<div id='" + id + "'>" + content + "</div>" );
    tabs.tabs( "refresh" );
    $('#modal').trigger('close');
    tabs.tabs('option','active', $('#'+id).index()-1);
    indexTab++;
    $(".activo").find('.tablaQuotes, .tablaCuatro, .tablaCinco, .tablaSeis').dataTable({
        "aaSorting": [[1,'desc']]
    });
    $(".activo").find('.other').find('.tabui').dataTable({
        "aaSorting": [[2,'desc']],
        "iDisplayLength": 5
    });
    $(".activo").find('.gal').carouFredSel({
        circular:false,
        infinite:false
    });
    $(".activo").find(".grupo").colorbox({
        rel:'pt-'+tabId, transition:"none", width:"75%", height:"75%",
        onComplete:function(){
            $('#cboxLoadedContent').zoom();
        }
    });
}

And this is the code for the tabs:

var tabs = $( "#tabs" ).tabs({
    beforeActivate: function( event, ui ){
    },
    create: function( event, ui ){
    },
    activate: function( event, ui ){
        $('div').removeClass('activo');
        ui.newPanel.addClass('activo');
    }
});


$( "#tabs" ).tabs('paging');

2 Answers 2

1

Check the rendered HTML output and Javascript of the plugins you are using, as I found that the old "globalPanel" functionality no longer works in jQuery 1.9. All the content of tabs must be a descendant of the tab elements.

Sign up to request clarification or add additional context in comments.

Comments

0

Well I've fixed it. i just add $('#tabs').tabs('pagingDestroy'); and $('#tabs').tabs('paging');

to destroy and initialize the plugin each time i add a new tab. I was doing this first but i was doing it in a wrong place ( inside beforeActivate() ), that why never worked. i just moved to addSearchResult();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.