Opened 8 years ago

Closed 8 years ago

#7930 closed bug (worksforme)

Incorrect AJAX call when preselecting a tab

Reported by: palbandoz Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.tabs Version: 1.8.16
Keywords: Cc:
Blocked by: Blocking:

Description

When activating a jQueyUI Tabs with a preselected tab different than the first one, the selected tab is visually correct but the AJAX call done is not the right one, but the previous tab's one.

For instance, in the next example, if the initialActiveTab is 4, the tab titled "EEE" is selected but the AJAX call is './?ajax=3&tab=ddd'. So there is nothing showed in the selected tab.

HTML:

<div id="tabs">
	<ul>
        
<li><a href='./?ajax=3&tab=aaa'>AAA</a></li>
<li><a href='./?ajax=3&tab=bbb'>BBB</a></li>
<li><a href='./?ajax=3&tab=ccc'>CCC</a></li>
<li><a href='./?ajax=3&tab=ddd'>DDD</a></li>
<li><a href='./?ajax=3&tab=eee'>EEE</a></li>
<li><a href='./?ajax=3&tab=fff'>FFF</a></li>
<li><a href='./?ajax=3&tab=ggg'>GGG</a></li>
	</ul>
</div><!--#tabs-->
<input type="hidden" id="initialActiveTab" value="4"/>

Javascript:

$(document).ready( function() {
    $("div#tabs").tabs({ selected: $("#initialActiveTab").val() });
});

Change History (2)

comment:1 Changed 8 years ago by palbandoz

I guess the problem starts with the hrefs assigned by jQueryUI, that start in #ui-tabs-1 instead of #ui-tabs-0:

<div class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
	<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
        
<li class="ui-state-default ui-corner-top"><a href="#ui-tabs-1">AAA</a></li>
<li class="ui-state-default ui-corner-top"><a href="#ui-tabs-2">BBB</a></li>
...

comment:2 Changed 8 years ago by Scott González

Resolution: worksforme
Status: newclosed

I'm not seeing the behavior you describe.

Note: See TracTickets for help on using tickets.