سؤال

Good day.

I want to apply such event in all tabs on the page, how can I do it?

    activate: function (event, ui) {
        var $t = ui.newPanel.find('table');
        // make sure there is a table in the tab
        if ($t.length) {
            if ($t[0].config) {
                // update zebra widget
                $t.trigger('applyWidgets');
            } else {
                // initialize tablesorter
                $t.tablesorter({
                    theme: 'black',
                    widgets: ["zebra"]
                });
            }
        }
    } 
هل كانت مفيدة؟

المحلول

Possibly by letting the event bubble up and capturing it there.

$(document).on('tabsactivate',function(event,ui){
 // your stuff here
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top