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

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3542
    Vote Rating
    846
    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 Forum Manager
    ________________
    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
    82
    Answers
    3
    Vote Rating
    2
    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
    82
    Answers
    3
    Vote Rating
    2
    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