PDA

View Full Version : How to navigate NestedList on itemDoubleTap instead of itemtap?



MaciejZabielski
16 Sep 2011, 4:07 AM
Hi, I have a NestedList and all records are equally important, so I need to be able to select items on itemtap on any level, or to navigate deeper on itemDoubleTap. Do I have to override original functions, or is there any other way? Can you please give me an example how to override onItemTap public method to perform selection, and onItemDoubleTap to perform navigation that was used by onItemTap? The other thing that comes to my mind is a little arrow button on each item, but still, I need to prevent original navigation and change it to selection.
Thank you!

Mthor
16 Sep 2011, 12:22 PM
http://stackoverflow.com/questions/5856482/how-to-detect-doubletap-without-triggering-silgeltap-in-sencha-touch

that might give another solution

MaciejZabielski
16 Sep 2011, 1:18 PM
Well, that is something that I might need later. For now I have decided to extend original NestedList and remove eventListener that is used on item tap, add new listener - "selecting" logic on itemtap by the original list component, and ondoubletap event uses former onitemtap.

The code that I have used is simply:

this.onItemDoubleTap = this.onItemTap;
this.removeListener('itemtap', this.onItemTap, this);
this.on('itemdoubletap', this.onItemDoubleTap, this);