Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: prevent double clicking a list view for whole app

  1. #1
    Sencha User
    Join Date
    Feb 2014
    Posts
    102
    Answers
    1

    Default prevent double clicking a list view for whole app

    I wanted to prevent double clicking a list view because , if I double click a view, two pages of the same view are displayed on top of each other.
    In order to do that, I used the following function

    Code:
    push: function (view) {
          if (typeof this.getActiveItem() == 'undefined' || this.getActiveItem().xtype != view.xtype)
             this.callParent(arguments);
          else {
             console.warn("Prevented pushing a potentially duplicate view of xtype: " + view.xtype);
    		 }
          },
    It works well and prevents double clicking.
    But I have to keep this code in every single page of my app where I want to prevent the double clicking.
    Is there a way to use this code only once so that whole app is affected?

    Thanks

  2. #2
    Sencha User
    Join Date
    Apr 2013
    Location
    Hyderabad
    Posts
    37

    Default

    Same question, let us know how to do this.
    --
    Abhi

  3. #3
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108
    Answers
    342

    Default

    Try adding a buffer to your listener. Covered within the Listener Options section of the following guide:
    http://docs.sencha.com/touch/2.3.1/#...stener-options
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  4. #4
    Sencha User
    Join Date
    Feb 2014
    Posts
    102
    Answers
    1

    Default

    I tried using buffer in my push function and also in listener ,
    but it's not working.
    Also I need to disable the double click for the entire app, not just single listeners so that I don't have to disable for all the listeners in all the pages.
    Is this possible?
    Please help me with this.
    Thanks

  5. #5
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108
    Answers
    342

    Default

    http://docs.sencha.com/touch/2.3.1/#...t-method-setup

    See section on eventPublishers. You can add this config to your Ext.application to change the default recognizers.
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  6. #6
    Sencha User
    Join Date
    Feb 2014
    Posts
    102
    Answers
    1

    Default

    I tried giving id's to all my pages.
    So sencha won't allow two pages of same id to be created, so I have only one view even when I double click.
    Will I have any other issues by doing this?

    Also, it doesn't work for back button.
    When I click back button twice, it navigates to the original page, but that page goes blank. Any way to reslove this?
    PS: This problem is only in windows phone, I can't double click on android and IOS phones.

    Thanks

  7. #7
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108
    Answers
    342

    Default

    Use itemId instead of id. itemId only have to be unique within a container.
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  8. #8
    Sencha User
    Join Date
    Feb 2014
    Posts
    102
    Answers
    1

    Default

    OK, Thanks,
    But what should I do about double clicking back button?
    When I double click the back button, my page goes blank ( only the tabbars are visible ). Any way to resolve this issue?

  9. #9
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108
    Answers
    342

    Default

    Could you please clarify are you referring to the back button of a navigation view, nested list or some other component?
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  10. #10
    Sencha User
    Join Date
    Feb 2014
    Posts
    102
    Answers
    1

    Default

    Back button of the navigation view. When I tap it twice, it goes back to my previous view, but that page goes blank ( only the content in the tabs are visible ).

Page 1 of 2 12 LastLast

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
  •