loading content in tabs with ajax

mauro72 - May 25, 2007 - 20:54
Project:Javascript Tools
Version:5.x-0.6
Component:Tabs
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I want to load the content of the tab using ajax, with the method that is show in this page http://www.stilbuero.de/2007/02/05/tabs-plugin-update-support-for-unobtr..., but so far I had not luck. It seems to create the right code in the page but the content is not loaded. If someone Knows how to implement this feature with drupal tabs, please point me in the right direction.
thank you very, very, much.

#1

nedjo - May 25, 2007 - 21:15

See the method Drupal.tabsLocalTasks in tabs.js.

You need to install the HEAD version of jstools and enable tabs module, dynamicload, and also download and install pagearray.

Call Drupal.tabsLocalTasks on a given page that has normal Drupal tabs and your tabs will be loaded via AJAX.

#2

mauro72 - May 26, 2007 - 18:24

Thank you Nedjo for the information. I'd follow your instructions and now I have ajax working for local task in primary tabs. Apparently this only works for UL's tags with class "tabs primary", and I wonder if is posible to use this function in UL's tags with other class, like <ul class="tabs remote"> ... </ul>. Is this posible using the same function or is necesary to create another one?.
Thank you for your help.

#3

mauro72 - May 26, 2007 - 19:31

I did something that makes the thing works, I changed from the file tabs.js these lines of code:
$('ul.anchors.tabs.primary') to   $('ul.anchors.tabs.remote')
and:
$(elt).find('ul.tabs.primary') to $(elt).find('ul.tabs.remote')
In FF I had an error, that was fix when I'd comment out this line in tabs.js:
// document.getElementById('section-' + activeIndex).appendChild(oldDiv);
I don't know if these changes can cause future problems or if it is the right way of do it.
I'll wait for suggestions, thank you again!

#4

kenorb - January 15, 2009 - 04:31

try quicktabs module

 
 

Drupal is a registered trademark of Dries Buytaert.