PDA

View Full Version : Ext.data.NodeInterface quick question



aliasneo
21 Sep 2011, 11:13 AM
Sorry if this was answered earlier...

I am simply trying to detect a node click within my tree. The decorated Ext.data.NodeInterface has events for expand, collapse, and various other events...but is missing CLICK. Must I attach a listener to my Ext.tree.Panel? This seems very inconsistent. Thanks.

zombeerose
21 Sep 2011, 11:57 AM
I agree that for completeness, the node should probably have other specific events, such as click, but it currently does not. The tree panel includes itemexpand, itemcollapse, etc.as well as itemclick.

Now then, from an efficiency stand-point, it is better to define only 1 handler that processes all node clicks instead of a single function for each & every node. Is there a specific use-case that necessitates a specific handler in your case?

aliasneo
21 Sep 2011, 12:06 PM
I agree that for completeness, the node should probably have other specific events, such as click, but it currently does not. The tree panel includes itemexpand, itemcollapse, etc.as well as itemclick.

Now then, from an efficiency stand-point, it is better to define only 1 handler that processes all node clicks instead of a single function for each & every node. Is there a specific use-case that necessitates a specific handler in your case?

Nope -- I will move everything into tree panel listeners per your suggestion. Thanks a lot for this best practice.