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.).
  [ 1 post ]
New Topic | Post Reply | Print view
Previous topic | Next topic

Sebastián Gurin

  • Offline
  • Profile
Tags:
  • icon
  • node icons
  • tree
  • tree icon
  • tree view
  • treenode
  • attribute
  • element
  • io
  • json
  • node
  • selector

tree node custom icons

Post Posted: Tue Nov 30, 2010 11:38 am
+0-
Hi all. First of all alloyui is great! Now my question:

I'm creating a tree view using treenodes of type io (children nodes are poblated with json from server). I want to set custom icons to each node. The only documented attribute I found is iconEl, that accepts a node or selector that it seems to be being moved instead of copied to treenode icon place.

/**
* Icon element.
*
* @attribute iconEl
* @type Node | String
*/
iconEl: {
setter: A.one,
valueFn: function() {
return A.Node.create(ICON_TPL);
}
},

The only way I found to successfully use this is with a function that creates and return an img object with the icon like this: iconEl: (function(){var img = document.createElement("img"); img.src="icon.png"; return img;})().

Unfortunately, the json that define tree node children, returned by the server, must be a valid json string.
So my question is, can you provide me with a simple example on setting custom icons to aui tree nodes of io type?

Thanks in advance.
  [ 1 post ]
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