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

Re: TaskNode Example

Expand Messages
  • furenberger
    Sorry if this is a duplicate (my other message didnt appear to post). The oArgs.event in IE doesnt seem to populate. The object exists but all of the members
    Message 1 of 11 , Sep 24, 2009
      Sorry if this is a duplicate (my other message didnt appear to post).

      The oArgs.event in IE doesnt seem to populate. The object exists but all of the members are null. It works fine in Firefox. Any ideas?

      childTree.subscribe('clickEvent',function (oArgs) {
      var isDirectory = oArgs.node.data.siteData.IsDirectory;
      if(isDirectory)
      {
      handleChildNodeClick(oArgs.node);
      }
      else
      {
      oArgs.node.toggleHighlight();
      return false;
      }

      alert(oArgs.event);
      alert("Hi: " + YAHOO.util.Event.getTarget(oArgs.event));
      var target = YAHOO.util.Event.getTarget(oArgs.event);
      alert(target.className);
      if (YAHOO.util.Dom.hasClass(target,'ygtvcontent'))
      {
      //oArgs.node.toggleHighlight();
      }


      });

      --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
      >
      > If you don't put the parenthesis, you are just getting the reference to
      > the function. Basically, the parenthesis themselves are an operator
      > that says, execute the function at the location referenced resulting
      > from evaluating the previous expression. When you assign the listener
      > to the function, you are evaluating the reference to the function and
      > letting the custom event to execute it.
      >
      > furenberger escribió:
      > > Oh my gosh, I knew that. Thats the same as what was in the old TaskNode.
      > >
      > > What I was missing was when I tried to use
      > > childTree.onEventToggleHighlight;
      > > in the function
      > > rather than oArgs.node.toggleHighlight();
      > >
      > > Thanks Satyam!
      > >
      > >
      > > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
      > >
      > >> Sure:
      > >>
      > >> childTree.subscribe('clickEvent',function (oArgs) {
      > >> var target = YAHOO.util.Event.getTarget(oArgs.event);
      > >> if (YAHOO.util.Dom.hasClass(target,'whatever')) {
      > >> this.onEventToggleHighlight.apply(this,arguments);
      > >> // or:
      > >> // oArgs.node.toggleHighlight();
      > >> } else {
      > >> // do whatever else
      > >> }
      > >>
      > >> });
      > >>
      > >> ClassNames are usually a good option to locate things, each element in
      > >> each tree has a distinctive className and that makes it easy to
      > >> identify. Depending on what you are trying to locate, you might have to
      > >> go one or two levels up. You might use:
      > >>
      > >> if (YAHOO.util.Dom.hasClass(target,'whatever') || YAHOO.util.Dom.getAncestorByClassName(target,'whatever')) {
      > >>
      > >> but be careful with this because the method won't stop at the branch and
      > >> might locate an element with that classname from a branch higher up.
      > >> For most elements, this is not the case since the elements that make one
      > >> branch are in parallel with the DIV that contains the children.
      > >>
      > >> I hope this is what you are looking for, I'm not 100% sure I understood
      > >> your question. Hope it works.
      > >>
      > >> Satyam
      > >>
      > >>
      > >> furenberger escribió:
      > >>
      > >>> I'm sorry, I'm not following - can you help me get started?
      > >>>
      > >>> YUI Example:
      > >>> childTree.subscribe('clickEvent',childTree.onEventToggleHighlight);
      > >>>
      > >>> Doesnt work:
      > >>> childTree.subscribe('clickEvent',function (oArgs) {
      > >>> childTree.onEventToggleHighlight;
      > >>>
      > >>> });
      > >>>
      > >>> --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
      > >>>
      > >>>
      > >>>> The argument of the click event has two properties, the Node and the
      > >>>> actual Event object as provided by the browser. You can use target of
      > >>>> the Event object (method getEvent of the Event utility) to find put
      > >>>> precisely where the click happened and then decide what to do.
      > >>>>
      > >>>> Satyam
      > >>>>
      > >>>>
      > >>>> furenberger escribió:
      > >>>>
      > >>>>
      > >>>>> So with this functionality how would you override the clickevent?
      > >>>>>
      > >>>>> This works for me as described in the example.
      > >>>>> childTree.subscribe('clickEvent',childTree.onEventToggleHighlight);
      > >>>>>
      > >>>>> but when I try to add a anonomous function only the clicked node is highlighted. I am attempting to separate the click of the text from the check of the box - which is why TaskNode worked (clickEvent and checkEvent)
      > >>>>>
      > >>>>> childTree.subscribe('clickEvent',function (oArgs) {childTree.onEventToggleHighlight;} );
      > >>>>>
      > >>>>> --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
      > >>>>>
      > >>>>>
      > >>>>>
      > >>>>>> The new example was added along the update to 2.8. The feature had been
      > >>>>>> there all along and it was documented, but it is referred to as
      > >>>>>> highlighting so people didn't relate the example (which uses images of
      > >>>>>> checkboxes as background images for highlighting, but are not real
      > >>>>>> checkboxes) and the documented feature.
      > >>>>>>
      > >>>>>> Satyam
      > >>>>>>
      > >>>>>>
      > >>>>>> furenberger escribió:
      > >>>>>>
      > >>>>>>
      > >>>>>>
      > >>>>>>> --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>> That example is obsolete. Highlighting has been built into Node since
      > >>>>>>>> 2.7. See:
      > >>>>>>>>
      > >>>>>>>>
      > >>>>>>>>
      > >>>>>>>>
      > >>>>>>>>
      > >>>>>>> Thank you for the prompt response.
      > >>>>>>>
      > >>>>>>> Was that page marked obsolete anywhere (as far as using a checkbox in a treeview)? I wish I would have known how to find this other page a week ago.
      > >>>>>>> Ryan
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>> http://developer.yahoo.com/yui/examples/treeview/tv_highlight.html
      > >>>>>>>>
      > >>>>>>>> Satyam
      > >>>>>>>>
      > >>>>>>>>
      > >>>>>>>> furenberger escribió:
      > >>>>>>>>
      > >>>>>>>>
      > >>>>>>>>
      > >>>>>>>>
      > >>>>>>>>> http://developer.yahoo.com/yui/examples/treeview/tasklist.html
      > >>>>>>>>>
      > >>>>>>>>> I was attempting to use this code in my environment however what I created only works in Firefox (not IE). While looking at the example code on this page and the actual code (using firebug) they are very different. In fact, your actual code wirks with both Firefox and IE. Was the actual code updated and the example an old version?
      > >>>>>>>>>
      > >>>>>>>>>
      > >>>>>>>>>
      > >>>>>>>>> ------------------------------------
      > >>>>>>>>>
      > >>>>>>>>> Yahoo! Groups Links
      > >>>>>>>>>
      > >>>>>>>>>
      > >>>>>>>>>
      > >>>>>>>>> ------------------------------------------------------------------------
      > >>>>>>>>>
      > >>>>>>>>>
      > >>>>>>>>> No virus found in this incoming message.
      > >>>>>>>>> Checked by AVG - www.avg.com
      > >>>>>>>>> Version: 8.5.409 / Virus Database: 270.13.112/2390 - Release Date: 09/23/09 05:52:00
      > >>>>>>>>>
      > >>>>>>>>>
      > >>>>>>>>>
      > >>>>>>>>>
      > >>>>>>>>>
      > >>>>>>>>>
      > >>>>>>> ------------------------------------
      > >>>>>>>
      > >>>>>>> Yahoo! Groups Links
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>
      > >>>>>>> ------------------------------------------------------------------------
      > >>>>>>>
      > >>>>>>>
      > >>>>>>> No virus found in this incoming message.
      > >>>>>>> Checked by AVG - www.avg.com
      > >>>>>>> Version: 8.5.409 / Virus Database: 270.13.112/2390 - Release Date: 09/23/09 05:52:00
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>
      > >>>>>>>
      > >>>>> ------------------------------------
      > >>>>>
      > >>>>> Yahoo! Groups Links
      > >>>>>
      > >>>>>
      > >>>>>
      > >>>>> ------------------------------------------------------------------------
      > >>>>>
      > >>>>>
      > >>>>> No virus found in this incoming message.
      > >>>>> Checked by AVG - www.avg.com
      > >>>>> Version: 8.5.409 / Virus Database: 270.13.112/2390 - Release Date: 09/23/09 05:52:00
      > >>>>>
      > >>>>>
      > >>>>>
      > >>>>>
      > >>>
      > >>>
      > >>> ------------------------------------
      > >>>
      > >>> Yahoo! Groups Links
      > >>>
      > >>>
      > >>>
      > >>> ------------------------------------------------------------------------
      > >>>
      > >>>
      > >>> No virus found in this incoming message.
      > >>> Checked by AVG - www.avg.com
      > >>> Version: 8.5.409 / Virus Database: 270.13.112/2390 - Release Date: 09/23/09 05:52:00
      > >>>
      > >>>
      > >>>
      > >
      > >
      > >
      > >
      > > ------------------------------------
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > > ------------------------------------------------------------------------
      > >
      > >
      > > No virus found in this incoming message.
      > > Checked by AVG - www.avg.com
      > > Version: 8.5.409 / Virus Database: 270.13.112/2390 - Release Date: 09/23/09 05:52:00
      > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.