Hi I'm working with the ui.tabs code from jQuery (http://
docs.jquery.com/UI/API/1.7.1/Tabs).
I want to create a tab with a link for refreshing another tab without
viewing it.

So i have a parenttab and a child tab. The child tab is opened by the
parent. The child tab knows its parenttab by it's divID.

I have the following working code (BUT it first selects the parent
tab, reloads its content and then switch back to the childtab. The
problem is I don't want to switch the tabs and instant reload the
parenttab):

tab.switcher.js:

var tabs_backend = new Array();

function get_parentTabID(selector){
  var tabs = $(selector + ' > div').tabs();
  var selected = $tabs.tabs('option', 'selected');
  return tabs[selected]['id'];
}

function set_childTabParentID(parentID){
  var tabs = $('#tabs > div').tabs();
  var selected = $tabs.tabs('option', 'selected');
  tabs_backend[tabs[selected]['id']] = parentID;
  return tabs[selected]['id'];
}

function refresh_parentTab(selector){
  var tabs = $(selector + ' > div').tabs();
  var selected = $tabs.tabs('option', 'selected');
  $tabs.tabs('load', $tabs.tabs('select', tabs_backend[tabs[selected]
['id']]).data("selected.tabs"));
  $tabs.tabs('select', $tabs.tabs('select', tabs[selected]['id']));
}

Parent tab link to open a child tab:
<span onclick="
var myParentID = get_parentTabID('#tabs');
tabsaddTab(\''.$uri.'\', \''.$tab_title.'\');
set_childTabParentID(myParentID); return false;
">

Can anybody help me fixing my problem?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to