1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    2
    Vote Rating
    0
    kruk is on a distinguished road

      0  

    Default Unanswered: itemsingletap buffer doesnt seem to work from controller

    Unanswered: itemsingletap buffer doesnt seem to work from controller


    Problem:
    Tapping a list item rapidly results in pushing two identical views into mainContainer (never more than two). Using itemsingletap instead is helping, but if I time a second tap just right (w/ a slight delay btwn tap 1 and tap 2) I can still cause the issue to occur.

    Desired Result:
    a single tap would trigger the listener to stop listening and to start listening again only after the view push has completed

    My list is defined in the view - 'mylist' is a custom xtype that extends Ext.List:
    Code:
    {
         xtype : 'mylist',
         flex : 1,
         scrollable: true
    }
    My listener and corresponding functionality is defined in the controller:

    Code:
    control: {
                
         myList: {
              itemsingletap: 'onMyListSingleItemTap'
         }
    }
    .
    .
    .
    onMyListSingleItemTap: function(me, index, target, record, e, eOpts) {
         this.push(Ext.create('Project.view.item', {
              item: record
         }));
    }
    .
    .
    .
    push: function(view) {
         var mainContainer = Ext.Viewport.down('view-main');
         var currentview = mainContainer.getActiveItem();
         currentview.push(view);
    }
    I've tried to implement the buffer for the itemsingletap listener, but doesn't seem to be working. What is the best way to implement the buffer here? Or am I going about this the wrong way? Thanks in advance!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,642
    Vote Rating
    899
    Answers
    3574
    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


    It's not about what event you use, it's about the logic behind it. It takes the browser a little bit to render the HTML created by you pushing a new view and then animate to that item which is why you can tap on the list again.
    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.

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Posts
    2
    Vote Rating
    0
    kruk is on a distinguished road

      0  

    Default


    Is buffer the best way to turn-off the listener while the browser renders the html and animates? I've tried adding it in to the controller as follows but it doesn't seem to make a difference. Any suggestions?

    Code:
    control: {
         myList: {
              itemsingletap: 'onMyListItemSingleTap',
              buffer: 500
         }
    }

Thread Participants: 1

Tags for this Thread