Relaunching the same scoreboard index event

I use jQuery UI tabs to trigger a show event, I use the following statement $ tabs.tabs ('select', 1); after executing this code, the tab is set to # tabs-1, but I was not able to fire the same event on the same tab when # tabs-1 is already shown. therefore, how to re-trigger the same tab event.

0
source share
2 answers

I assume that you are loading the contents of the tab through ajax. If so, you can use the download method to reload or load any tab.

$tabs.tabs('load',1); 
0
source

Perhaps you already understood this or received a solution from another message. I am posting an answer that works for me.

In jquery-ui-1.8.21.js

 if (( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible) || $li.hasClass( "ui-state-disabled" ) || $li.hasClass( "ui-state-processing" ) || self.panels.filter( ":animated" ).length || self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) { this.blur(); return false; } 

When a tab is selected, the first two conditions

 ( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible) 

so that if you omit them, when you click on the selected tab again, it will not return false, so it will again call up the selection on the selected tab.

PS - Because of this, I have not yet seen any flaws, so you can do some additional checks to see that it did not break anything.

0
source

All Articles