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

YUI TreeView dblClickEvent

Expand Messages
  • matt_ammer
    I can t seem to find an example of a double click event where the event identifies the node that was double clicked. The examples only show how to trap the
    Message 1 of 4 , Mar 31, 2009
    • 0 Attachment
      I can't seem to find an example of a double click event where the event identifies the node that was double clicked. The examples only show how to trap the node for a single click and how to invoke the editor for a double click.

      I have tried adding this javascript to my page and it does display the alert but does not identify the node that was clicked:

      tree.subscribe("dblClickEvent", function(node){
      alert(node.label + " label was double clicked");
      });

      How can I accomplish this?

      Thanks!
    • Satyam
      The click events don t receive a node object but an object with two properties, event and node. This should work tree.subscribe( dblClickEvent ,
      Message 2 of 4 , Mar 31, 2009
      • 0 Attachment
        The click events don't receive a node object but an object with two
        properties, event and node. This should work

        tree.subscribe("dblClickEvent", function(oArgs){
        alert(oArgs.node.label + " label was double clicked");
        });

        This examples show how it works, they show a message with the node
        clicked or double clicked:

        http://developer.yahoo.com/yui/examples/treeview/tv-edit.html

        Satyam


        matt_ammer escribió:
        > I can't seem to find an example of a double click event where the event identifies the node that was double clicked. The examples only show how to trap the node for a single click and how to invoke the editor for a double click.
        >
        > I have tried adding this javascript to my page and it does display the alert but does not identify the node that was clicked:
        >
        > tree.subscribe("dblClickEvent", function(node){
        > alert(node.label + " label was double clicked");
        > });
        >
        > How can I accomplish this?
        >
        > Thanks!
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.5.285 / Virus Database: 270.11.35/2033 - Release Date: 03/31/09 13:05:00
        >
        >
      • malutanpetronel
        tree.subscribe( dblClickEvent , function(oArgs){ alert(oArgs.node.label + label was double clicked ); }); is not working for me either ! I removed all the
        Message 3 of 4 , Apr 1, 2009
        • 0 Attachment
          tree.subscribe("dblClickEvent", function(oArgs){
          alert(oArgs.node.label + " label was double clicked");
          });

          is not working for me either ! I removed all the events on my tree and all the after rendering procedures and I dbl click without success when using treeview 2.7.0 but a editor is shown with 2.6.0 ! I am creating the tree with a tasknode function from checkbox examples ....

          --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
          >
          > The click events don't receive a node object but an object with two
          > properties, event and node. This should work
          >
          > tree.subscribe("dblClickEvent", function(oArgs){
          > alert(oArgs.node.label + " label was double clicked");
          > });
          >
          > This examples show how it works, they show a message with the node
          > clicked or double clicked:
          >
          > http://developer.yahoo.com/yui/examples/treeview/tv-edit.html
          >
          > Satyam
          >
          >
          > matt_ammer escribió:
          > > I can't seem to find an example of a double click event where the event identifies the node that was double clicked. The examples only show how to trap the node for a single click and how to invoke the editor for a double click.
          > >
          > > I have tried adding this javascript to my page and it does display the alert but does not identify the node that was clicked:
          > >
          > > tree.subscribe("dblClickEvent", function(node){
          > > alert(node.label + " label was double clicked");
          > > });
          > >
          > > How can I accomplish this?
          > >
          > > Thanks!
          > >
          > >
          > >
          > > ------------------------------------
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > > ------------------------------------------------------------------------
          > >
          > >
          > > No virus found in this incoming message.
          > > Checked by AVG - www.avg.com
          > > Version: 8.5.285 / Virus Database: 270.11.35/2033 - Release Date: 03/31/09 13:05:00
          > >
          > >
          >
        • malutanpetronel
          I see as a possible problem this function ? or maybe a missing parameter to be sent to tree to know that it is a HTML node tree ? : ...
          Message 4 of 4 , Apr 1, 2009
          • 0 Attachment
            I see as a possible problem this function ? or maybe a missing parameter to be sent to tree to know that it is a HTML node tree ? :
            ...
            YAHOO.extend(YAHOO.widget.TaskNode, YAHOO.widget.TextNode, {
            _type: "TaskNode",

            getContentHtml: function() {
            var sb = [];
            sb[sb.length] = '<td><span';
            sb[sb.length] = ' id="' + this.labelElId + '"';
            if (this.title) {
            sb[sb.length] = ' title="' + this.title + '"';
            }
            sb[sb.length] = ' class="' + this.labelStyle + '"';
            sb[sb.length] = ' >';
            sb[sb.length] = this.label;
            sb[sb.length] = '</span></td>';

            sb[sb.length] = '<td style="color:#A33; font-size:0.85em;"><i>';
            sb[sb.length] = ' ' + this.oData.Language;
            sb[sb.length] = '<\/i><\/td>';
            return sb.join("");
            }
            });
            ..
          Your message has been successfully submitted and would be delivered to recipients shortly.