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

Re: [ydn-javascript] Re: simple menu for treeview (onmouseover)

Expand Messages
  • Satyam
    Assuming you have a node by any means you care to, for example, as the argument from a labelClick event listener: myTree.subscribe( labelClick , function(node)
    Message 1 of 9 , Sep 2, 2008
    • 0 Attachment
      Assuming you have a node by any means you care to, for example, as the
      argument from a labelClick event listener:

      myTree.subscribe("labelClick", function(node) {
      alert(node.data.name + " was clicked");
      });

      Satyam


      dufferdo25 wrote:
      > I managed to get the contextMenu to work but I have the need to create
      > a custom property for the TextNode called name (or whatever).
      >
      > var myobj = { title:"label-" + n, label: n, href:"xmpp:" + n,
      > name:"name"+n };
      > oTextNode = new YAHOO.widget.TextNode(myobj, oTreeView.getRoot(), false);
      > ...
      > ...
      >
      >
      > Now the API states:
      > All other attributes are made available in noderef.data, which can be
      > used to store custom attributes.
      >
      > How do I access this property?
      >
      > I would still like to use the menu instead of the contextMenu so if
      > there are any examples, I would appreciate it.
      > TIA!
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - http://www.avg.com
      > Version: 8.0.169 / Virus Database: 270.6.14/1645 - Release Date: 01/09/2008 7:19
      >
      >
    • dufferdo25
      Thanks Satyam, I thought I had this contextMenu figured out but it seems that I only get a context menu on the groups and not on the individual nodes eg.. cars
      Message 2 of 9 , Sep 2, 2008
      • 0 Attachment
        Thanks Satyam,
        I thought I had this contextMenu figured out but it seems that I only
        get a context menu on the groups and not on the individual nodes eg..

        cars
        --chevrolet
        -----camaro
        -----corvette
        --mercedes
        -----ml350

        So the context is only available on cars, chevrolet and mercedes and
        not on camaro, corvette, ml350

        Any ideas?

        code:
        YAHOO.util.Event.onAvailable("rosterDiv", function () {
        loadContextMenu();
        });

        var loadContextMenu = function() {
        var oContextMenu = new YAHOO.widget.ContextMenu("mytreecontextmenu", {
        trigger: "rosterDiv",
        lazyload: true,
        itemdata: [
        { text: "Shadow", onclick: { fn: shadowClick } },
        { text: "Chat", onclick: { fn: chatClick } },
        { text: "Send file", onclick: { fn: fileClick } }
        ] });
        oContextMenu.subscribe("triggerContextMenu", onTriggerContextMenu);
        //END MENU
        }

        TIA!
      Your message has been successfully submitted and would be delivered to recipients shortly.