Ticket #3527 (closed bug: notabug)

Opened 5 years ago

Last modified 19 months ago

No way to disable AJAX/remote tabs in ui.tabs

Reported by: abitgone Owned by: klaus.hartl
Priority: minor Milestone:
Component: ui.tabs Version: 1.6rc2
Keywords: tabs remote ajax disable Cc:
Blocking: Blocked by:

Description

There doesn't appear to be a way to turn off the remote/AJAX tabs feature, either for an entire collection of tabs, or for single tabs.

Using the syntax from the older version of tabs we once used doesn't appear to have the desired effect:

$(".TabStrip").tabs({
    remote: false
});

Looking through the documentation, it appears that the feature has been dropped.

Change History

comment:1 Changed 5 years ago by klaus.hartl

  • Status changed from new to closed
  • Resolution set to invalid

The alternative is to use in-page tabs, it's as simple as that. The remote option in the former version was actually only required because the Ajax tabs functionality was baked in later on and it was actually required to tell tabs that they're Ajax tabs via remote: true and not the other way round. All this is handled automatically in UI Tabs so that a developer doesn't have to worry about another option and more important, can easily mix Ajax and in-page tabs.

The possibility to supress tab loading and to open tabs as standard links is discussed in the UI Tabs FAQ.

comment:2 Changed 5 years ago by orangechicken

Can you please provide a link to the UI Tabs FAQ that tells us how to disable remote tab loading and just use standard links (if they're not named anchors)?

I often have navs that *mostly* consistent of in-page tabs but contain one or two external links. The in-page tabs are anchors to named anchors (IDs) and the external links are, obviously, regular relative/absolute paths.

I can't figure out how to disable remote tab loading. I just want the external-linked tabs to go to their URLs.

comment:3 Changed 5 years ago by orangechicken

Nevermind. I found a "how to" in the Tab's FAQ and fixed it for clarity. It was originally called "how to ... open a tab in a new window" which is why I paid it no mind. Turns out, it wasn't actually a how to on opening a tab in a new window.

It did, however, provide the basis for "how to follow a tab's URL instead of loading its content via ajax" which is in the FAQ now. Find it at  http://docs.jquery.com/UI/API/1.7.1/Tabs#...follow_a_tab.27s_remote_URL_instead_of_loading_its_content_via_ajax

comment:4 Changed 3 years ago by sebpiq

I am using the "hashchange" event (e.g.  http://jsfiddle.net/59W73/), and I have to do very hackish stuff, that I wouldn't have to do if I could just disable remote loading, like it used to be possible.

The problem is that at the moment I cannot handle "hashchange" event in a transparent way, ... because if the hash changes because of a tab click, then I shouldn't reload the page (because it is reloaded automatically), however if the hash changes because I clicked on a link, then I want to reload the page.

Disabling automatic ajax loading would allow to solve this situation in a very simple way.

Last edited 3 years ago by sebpiq (previous) (diff)

comment:5 Changed 3 years ago by wolever

The fixes/workarounds discussed here don't seem to work for me.

I'd like the default tab's content to be present when the page first loads. Eg:

<div id="tabs">
  <ul>
    <li><a href="first">First</a></li>
    <li><a href="second">Second</a></li>
  </ul>
  <div id="tabContent" class="ui-tabs-panel">
    This is the content of the “First” tab!
  </div>
</div>
<script>
$("#tabs").tabs({
  select: function() { return false; },
  selected: 0
});
</script>

But even when select returns false, ui.tabs tries to run the Ajax request to load the selected tab.

Ideally, it would be possible to control the AJAX portions separately from the UI portions.

comment:6 Changed 19 months ago by scott.gonzalez

  • Milestone TBD deleted

Milestone TBD deleted

Note: See TracTickets for help on using tickets.