tree click and dblclick both raised - Ext JS

In my tree setup i'm catching the node click and dblclick, but for a doudble click the single click event is also raised..

In this post the problem is also mentioned.. Anyone added this code to the tree?

http://www.yui-ext.com/forum/viewtop...e9f3899c53fed6

Thanks

Marco
  # 2  
03-15-2007, 10:37 AM

Qouted from quirksmoede:

"The dblclick event fires after the user has clicked twice in rapid succesion on the same element. All browsers support it.
The incompatibilities are in the succession of events leading up to the dblclick. Every browser uses a different event order.

In practice it is not possible to use both the click and dblclick events on the same element. The browsers aren't sufficiently able to distinguish between them"

That said it depends on what you want to do when the click and dbl click happens.
For example, I have had an outlook like list that onclick loads the preview and ondblclick opens an edit window. To avoid double loading the click just checks to see if the preview already contains the right information. So you can make your click handler look for evidence of a dblclick, bt the fact that it has been called twice. If you absolutely need to prevent the click handler from firing, you will need to delay the execution long enough to allow the dblclick to fire first and it will need to cancel the clickTimeout.
  # 3  
03-15-2007, 11:04 AM

Thanks.. i've got a similar situation (on two places)..
- tree
. click = change activepanel in center with a new page
. dblclick = add new panel in center with a new page

- grid
. click = load preview
. dblclclick = show edit dialog

The default doubleclick delay in windows is set to 500ms.. That means that a click event should only be raised if not within 500ms a new click has been catched.. That's a long delay before something is happening after a single click..

I think i change the code to look for a shift / control key and single click.. Other ideas are welcome!!

Thanks

Marco
  # 4  
03-15-2007, 11:21 AM

Quote:
- tree
. click = change activepanel in center with a new page
. dblclick = add new panel in center with a new page
Out of curiosity, are you saying that double-clicking an existing node in the tree creates a newly added node/panel? That seems like a strange interaction to me. I would think you'd have a special "Add" node or a separate button outside the tree.

Quote:
- grid
. click = load preview
. dblclclick = show edit dialog
Seems like you'd want both to happen regardless, right? If you have an active preview loaded and you immediately double-click on a different row, you would want to refresh the preview AND show the edit for the previewed item right?
__________________
Brian Moeskau
FAQ / Tutorials / User Extensions / Enhanced Forum Search
  # 5  
03-15-2007, 12:30 PM

Quote:
Originally Posted by bmoeskau
Out of curiosity, are you saying that double-clicking an existing node in the tree creates a newly added node/panel? That seems like a strange interaction to me. I would think you'd have a special "Add" node or a separate button outside the tree.
My tree contains only folders.. Each folder contains objects that are shown in a (paging) grid in the center panel.. I want to have multiple tabs in the centerpanel, each tab contains the objects from a folder.. Users can decide if they want to view the contents in a separate tab (or load the contents in the active tab) by dblclicking (at least that was my idea)

Thanks
Marco

你可能感兴趣的:(windows,ext,UP,yui,idea)