1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Colombo, Sri Lanka
    Posts
    4
    Vote Rating
    0
    nissagala is on a distinguished road

      0  

    Default Answered: Extjs dataview click and double click event

    Hi,

    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.

  2. 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.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,555
    Vote Rating
    1121
    Answers
    3701
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default

    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 @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    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 services@sencha.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.

  4. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Colombo, Sri Lanka
    Posts
    4
    Vote Rating
    0
    nissagala is on a distinguished road

      0  

    Default

    @mitchellsimoens
    Thanks for the reply. But how can determine the first click of the double click. click fires before the double click so using time i cannot stop the first click of the double click

  5. #4
    Sencha User
    Join Date
    Jul 2011
    Location
    Pakistan
    Posts
    86
    Vote Rating
    2
    Answers
    3
    zonaib is on a distinguished road

      0  

    Default

    @mitchellsimoens

    how can i apply buffer to my itemclick event , in my case i was controlling it from controller


  6. #5
    Sencha User
    Join Date
    Jul 2011
    Location
    Pakistan
    Posts
    86
    Vote Rating
    2
    Answers
    3
    zonaib is on a distinguished road

      0  

    Default

    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

  7. #6
    Sencha User
    Join Date
    Aug 2013
    Posts
    23
    Vote Rating
    0
    sayaliingavale is on a distinguished road

      0  

    Default 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.

    Thanks