21 Mar 2013 10:07 PM #1
Answered: Extjs dataview click and double click event
I have a problem in dataview where itemclick events fires twice on item double click. I want to use itemdblclick event too. Is there any way to prevent firing itemclick event when double click.
You won't be able to prevent both events from firing as they are valid firing. I usually set a last clicked property to a date object for the itemclick and if the 2nd firing fires within some threshold then I don't proceed with the logic in the itemclick listener.
25 Mar 2013 7:53 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
You won't be able to prevent both events from firing as they are valid firing. I usually set a last clicked property to a date object for the itemclick and if the 2nd firing fires within some threshold then I don't proceed with the logic in the itemclick listener.Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
26 Mar 2013 8:04 PM #3
8 Apr 2013 5:01 AM #4
8 Apr 2013 8:41 PM #5
i have used buffer and delay methods but itemclick and itemdblclick are still not working simultaneously
Ext.Function.createBuffered(this.myEventFunction, 1000, this)
any suggestions will be appreciated
12 Apr 2015 7:10 AM #6
disable itemdoubleclick completely
Hi, Similar problem I am having with the itemclick and itemdblclick. I have a code written on itemclick event. I don't want itemdblclick anymore. By mistake user doubleclicks then my code in itemclick runs twice and causes some inertsibling of undefined error (as much data processing is done on the same event which may cause problem). So basically I dont want to execute code twice if user doubleclicks. Please reply ASAP.