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

Diable keydown event in treeview

Expand Messages
  • nkwok
    Hello, I am using release 2.7.0 and like to disable the key event in treeview like left arrow key and Home key. I tried with the following method
    Message 1 of 3 , Apr 29, 2009
    • 0 Attachment
      Hello,

      I am using release 2.7.0 and like to disable the key event in treeview like 'left' arrow key and 'Home' key.

      I tried with the following method

      atreeview.removeListener('keydown')

      and

      atreeview.subscribe('keydown', function(event) {YAHOO.util.Event.preventDefault(event);});

      They both did not work. What is the best way to disable the key event for treeview?


      Thanks,
      Norman
    • Satyam
      If atreeview is your instance of TreeView, it doesn t have any removeListener method at all. Subscribing to an event doesn t replace the previous
      Message 2 of 3 , Apr 30, 2009
      • 0 Attachment
        If atreeview is your instance of TreeView, it doesn't have any
        removeListener method at all. Subscribing to an event doesn't replace
        the previous subscription, it gets the new listener added to the list.

        YAHOO.util.Event.removeListener(atreeview.getEl(),'keydown');

        should work.

        Satyam


        nkwok escribió:
        > Hello,
        >
        > I am using release 2.7.0 and like to disable the key event in treeview like 'left' arrow key and 'Home' key.
        >
        > I tried with the following method
        >
        > atreeview.removeListener('keydown')
        >
        > and
        >
        > atreeview.subscribe('keydown', function(event) {YAHOO.util.Event.preventDefault(event);});
        >
        > They both did not work. What is the best way to disable the key event for treeview?
        >
        >
        > Thanks,
        > Norman
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.5.287 / Virus Database: 270.12.8/2086 - Release Date: 04/29/09 06:37:00
        >
        >
      • nkwok
        Satyam, removeListener() does work. Thanks ! Regards, Norman
        Message 3 of 3 , Apr 30, 2009
        • 0 Attachment
          Satyam,

          removeListener() does work. Thanks !


          Regards,
          Norman

          --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
          >
          > If atreeview is your instance of TreeView, it doesn't have any
          > removeListener method at all. Subscribing to an event doesn't replace
          > the previous subscription, it gets the new listener added to the list.
          >
          > YAHOO.util.Event.removeListener(atreeview.getEl(),'keydown');
          >
          > should work.
          >
          > Satyam
          >
          >
          > nkwok escribió:
          > > Hello,
          > >
          > > I am using release 2.7.0 and like to disable the key event in treeview like 'left' arrow key and 'Home' key.
          > >
          > > I tried with the following method
          > >
          > > atreeview.removeListener('keydown')
          > >
          > > and
          > >
          > > atreeview.subscribe('keydown', function(event) {YAHOO.util.Event.preventDefault(event);});
          > >
          > > They both did not work. What is the best way to disable the key event for treeview?
          > >
          > >
          > > Thanks,
          > > Norman
          > >
          > >
          > >
          > > ------------------------------------
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > > ------------------------------------------------------------------------
          > >
          > >
          > > No virus found in this incoming message.
          > > Checked by AVG - www.avg.com
          > > Version: 8.5.287 / Virus Database: 270.12.8/2086 - Release Date: 04/29/09 06:37:00
          > >
          > >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.