[ 5 posts ]

Richard Watkins

  • Username: smedrick
  • Joined: Tue Mar 24, 2009 11:41 am
  • Posts: 3
  • Offline
  • Profile

Tabview dataSrc issues with other YUI elements

Post Posted: Thu Mar 26, 2009 5:00 am
+0-
I'm having issues with using tabview and treeview together. I've set up the tabview so it grabs all tab content from separate .html files using dataSrc. One of the files that a tab loads its content from contains a treeview. Now, the treeview loads fine when I view the file directly, but when it's loaded using tabview, nothing shows up in the content. It appears the tab stays in the "loading" state.

Can this even be done?

Richard Watkins

  • Username: smedrick
  • Joined: Tue Mar 24, 2009 11:41 am
  • Posts: 3
  • Offline
  • Profile

Re: Tabview dataSrc issues with other YUI elements

Post Posted: Thu Mar 26, 2009 6:02 am
+0-
So after further investigation, I'm assuming I need to use the YUI Loader in some fashion.

Caridy Patino

YUI Contributor

  • Username: caridy
  • Joined: Mon Dec 08, 2008 5:40 pm
  • Posts: 493
  • Location: Miami, FL
  • Twitter: caridy
  • GitHub: caridy
  • Gists: caridy
  • IRC: caridy
  • YUI Developer
  • Offline
  • Profile

Re: Tabview dataSrc issues with other YUI elements

Post Posted: Thu Mar 26, 2009 7:28 am
+0-
Not exactly.

Depending on the way you want to implement this. You have 3 options:

1. you can include the requirements for the treeview component at the document level (head)
2. you can include the requirements on demand, using YUI Loader right before the instantiation process for the treeview.
3. you can delegate the requirements to the content of the tab, with means that the content loaded thru dataSrc will include also some CSS and JS files.

YUI Tabview supports all this options. The different is that 1 and 2 will require that part of the internal logic of the tab (creating a treeview object) will be at the document level, and because of that you have to wait until the tab become active/loaded, to fire that logic.

In the 3 approach, your tab and your application in general will not know what the tab will do. The content loaded within the tab is responsible to define/fire that logic, creating some kind of autonomy for that content.

I don't have an example for the treeview, but I have one for nested tabviews, which is quite similar:

http://bubbling-library.com/sandbox/dis ... bview.html

The first tab will load the content, and the tab itself execute the instantiation process when the content of the tab get ready:
var mySimpleTab = new YAHOO.widget.TabView('childtabview');

the second tab relay on the content to create the tabview.

The first tab will works with a "plain" yui implementation as well. The second one requires the dispatcher plugin.

Best Regards,
Caridy

Richard Watkins

  • Username: smedrick
  • Joined: Tue Mar 24, 2009 11:41 am
  • Posts: 3
  • Offline
  • Profile

Re: Tabview dataSrc issues with other YUI elements

Post Posted: Thu Mar 26, 2009 9:41 am
+0-
Wow, this dispatcher plugin is exactly what I need. Thanks!

Caridy Patino

YUI Contributor

  • Username: caridy
  • Joined: Mon Dec 08, 2008 5:40 pm
  • Posts: 493
  • Location: Miami, FL
  • Twitter: caridy
  • GitHub: caridy
  • Gists: caridy
  • IRC: caridy
  • YUI Developer
  • Offline
  • Profile
Tags:

Re: Tabview dataSrc issues with other YUI elements

Post Posted: Thu Mar 26, 2009 10:46 am
+0-
I'm glad to help.

Best Regards,
Caridy
  [ 5 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum