Loading ...
Sorry, an error occurred while loading the content.

Re: Overriding labelStyle of TextNode

Expand Messages
  • jr_tunstall
    Eric, Cheers for the clearing that up. Have a great 07. James
    Message 1 of 5 , Jan 3, 2007
    • 0 Attachment
      Eric,

      Cheers for the clearing that up.

      Have a great 07.

      James


      --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
      >
      > James,
      >
      > Happy new year!
      >
      > Your use of the TreeView API is just a bit off in the example that's
      > not working. You can set the labelStyle in two ways...the first one
      > you deduced as follows:
      >
      > //this works and the style changes
      > var oDataStyle = { style:"urgentlink", label:"using style" };
      > var tmpNode = new YAHOO.widget.TextNode( oDataStyle, root, false);
      >
      > When you do this, the TextNode class sees the generic style indicator
      > and applies it to the labelStyle property for you in line 1797ff of
      > TreeView.js:
      >
      > if (oData.style) {
      > this.labelStyle = oData.style;
      > }
      >
      > The second method is to apply the property directly to your node
      > instance after you've created it:
      >
      > var myNode = new YAHOO.widget.TextNode(...);
      > myNode.labelStyle = "mystyle";
      >
      > Either of these should work just fine.
      >
      > Regards,
      > Eric
      >
      > ______________________________________________
      > Eric Miraglia
      > Yahoo! User Interface Library
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.