Results 1 to 6 of 6

Thread: Extjs dataview click and double click event

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Colombo, Sri Lanka
    Posts
    4
    Vote Rating
    0
      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
    39,553
    Answers
    3931
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Colombo, Sri Lanka
    Posts
    4
    Vote Rating
    0
      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
    93
    Answers
    4
    Vote Rating
    3
      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
    93
    Answers
    4
    Vote Rating
    3
      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
      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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •