View Full Version : Can you open the context menu of a tree node using a different event?

7 Sep 2011, 4:12 AM
I was wondering if it's possible to open the context menu of a tree node using an event other than the contextmenu event? For example, can you open the context menu using a double click event? The reason I ask is for the purposes of using the ExtJS tree on an iPad where there is no right-click event.



8 Sep 2011, 2:08 AM
Sure, attach a dblclick event listener that creates a menu:

node.on('dblclick', function(node, event) {
new Ext.menu.Menu({...}).showAt(event.getXY());

P.S I don't know anything about it, but if you are targeting the iPad maybe Sencha Touch is better than ExtJS, which is more for PC browsers with a mouse.