Forums

Posting in these forums is disabled. These forums will be available for archive purposes. Please join the new forums at the links below:

  • yui-support - replaces the `YUI 3.x` and `YUI 3 Gallery` forums.
    We have created the following discussion categories within this group to aid discoverability for these most-used topics:
    • Charts for YUI Charts support.
    • DataTable for YUI DataTable support.
    • Gallery for YUI Gallery support, including support for published Gallery components as well as the Gallery process in general.
    • Tools for support of YUI’s suite of developer tools such as selleck, shifter, grover, yogi, etc.
    • Everything Else for questions that don’t fit one of the categories above, we’ve got you covered here.
  • yui-deprecated - replaces the `YUI 2.x` forum and the forums of other deprecated products (`YUI Doc`, `Builder`, `YUI PHP Loader`, etc.).
  [ 4 posts ]
New Topic | Post Reply | Print view
Previous topic | Next topic

Brian J. Miller

YUI Contributor

  • Offline
  • Profile

Default a node to open?

Post Posted: Thu Feb 03, 2011 9:04 am
Is there a way (read: a simple way) to have specific nodes default to open? I figure I can possibly loop over the initial data source potentially calling toggle() to open specific nodes after rendering, though I'm not even sure of that.

John Lindal

YUI Contributor

  • Username: jafl
  • Joined: Mon Nov 02, 2009 2:33 pm
  • Posts: 390
  • Location: Los Angeles, CA
  • Twitter: jafl5272
  • GitHub: jafl
  • Gists: jafl
  • Offline
  • Profile
Tags:
  • datasource
  • node
  • treeble

Re: Default a node to open?

Post Posted: Mon Apr 11, 2011 2:12 pm
Sorry I didn't find this post sooner!

The difficulty is that opening a node requires a request to the datasource to figure out how many children there are. So it is not a synchronous process. For example, to open a child of a child, you have to call my_table.datasource.get('datasource').toggle() three times, and each call must be nested inside the completion function of the previous call.

If all you want to do is open a top-level node, call my_table.datasource.get('datasource').toggle() with the node index (as an array, e.g., [3]).

I will investigate whether or not it is possible to pass the open state in the data.

John Lindal

YUI Contributor

  • Username: jafl
  • Joined: Mon Nov 02, 2009 2:33 pm
  • Posts: 390
  • Location: Los Angeles, CA
  • Twitter: jafl5272
  • GitHub: jafl
  • Gists: jafl
  • Offline
  • Profile

Re: Default a node to open?

Post Posted: Mon Apr 11, 2011 3:43 pm
I just pushed an update which allows the initial state of openable nodes to be set in the data. Check the updated yuidoc for "openNodeKey".

William Vincent

  • Username: WilliamVincent
  • Joined: Thu May 30, 2013 6:05 pm
  • Posts: 1
  • Offline
  • Profile

Re: Default a node to open?

Post Posted: Thu May 30, 2013 6:10 pm
Hi John,

Not sure I should reopen this old post but question is the same. I see your notes regarding the openNodeKey as mentioned in your response, but fail to find any mention of this in any documentation. I cannot get it functional. Can you advise if this is still the proper mechanism and perhaps post back a simple sample of same ?

Many thanks

Vince


I just pushed an update which allows the initial state of openable nodes to be set in the data. Check the updated yuidoc for "openNodeKey".
  [ 4 posts ]
New Topic | Post Reply | Print view
Previous topic | Next topic
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