1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    9
    Vote Rating
    0
    crosslink06 is on a distinguished road

      0  

    Default Fire an event on tap and hold?

    Fire an event on tap and hold?


    Hi all,

    ItemTap and ItemDoubleTap events works good on my list items. What I am looking for to do is simply to fire the event when an item is tapped and hold (pressed 100ms).
    Do you guys have any idea/example about how I can do that please? I didn't find any help on the forum/API doc.

    Thank you

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,672
    Vote Rating
    748
    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


    Just a sample:

    Code:
    panel.mon(panel.el, {
        taphold: function(e, t) {}
    });
    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
    Sep 2011
    Posts
    9
    Vote Rating
    0
    crosslink06 is on a distinguished road

      0  

    Default


    Thanks Mitchellsimoens,

    This way works on a panel but not in my list which is included within a panel...
    The only way I've found to make it works is the following:

    views.News = new Ext.List({
    xtype: 'list',
    store: views.ListStore,
    itemTpl: '<div class="category">{DisplayName}</div>',
    filterOnLoad: true,
    onItemDisclosure: true,
    listeners: {
    el: {
    taphold: showActionSheet
    }
    }

    var showActionSheet = function (record, btn, index) {

    var store = views.ListStore;
    record = store.getAt(btn);
    var getrecord = record.get('DivisionId');

    var textItem;
    var uiItem;

    if (getrecord == '9') {
    textItem = "Publish";
    uiItem = "confirm";
    }
    else {
    textItem = "Unpublish";
    uiItem = "normal";
    }

    views.Actions = new Ext.ActionSheet({
    items: [
    {
    text: textItem,
    ui: uiItem,
    handler: views.ActionToPublishOrUnpublish
    },
    {
    text: 'Delete',
    ui: 'decline',
    handler: Ext.emptyFn
    },
    {
    text: 'Cancel',
    scope: this,
    handler: function () {
    views.Actions.hide();
    }
    }]
    });

    views.Actions.show();
    }

    However, the taphold event happens too early so the showActionSheet function parameters are null.
    This is a problem that i don't meet with a tap a double tap event.

    Do you have any tricks about how to fix it?
    Thank you,

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    9
    Vote Rating
    0
    crosslink06 is on a distinguished road

      0  

    Default


    nobody?

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    255
    Vote Rating
    2
    landed is on a distinguished road

      0  

    Question


    I have noticed the taphold only fires once as well. Would be very nice to repeat the event every X. I suppose the way to do this is look out for the release and until that happens keep doing the event.

    Or am I missing something.

  6. #6
    Sencha User
    Join Date
    Nov 2013
    Posts
    39
    Vote Rating
    0
    anilvardhan.p is on a distinguished road

      0  

    Default


    Hi Mitchellsimoens,

    How to implement taphold release in sencha touch 2, can you please help me

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar