1. #1
    Sencha User
    Join Date
    Dec 2012
    Location
    Bangalore India
    Posts
    6
    Vote Rating
    0
    tntv33 is on a distinguished road

      0  

    Default Answered: Override List behaviour, Tap event

    Answered: Override List behaviour, Tap event


    I want to override the behavior of a List. Normally ,on tap of a listitem, the listitem gets selected/deselected. I basically do not want this to happen on a tap, but i want the selection/deslection to happen ONLY on a 'itemtaphold'.

    Is there anyway i can override the selection/deseletion of item on itemtaphold instad of item tap. I am not well versed in Sencha. Any code snippit which will help me achieve would be appriciated.


    Code:
    Ext.create('Ext.List', {
        fullscreen: true,
        itemTpl: '{title}',
        allowDeselect :true,
        data: [
            { title: 'Item 1' },
            { title: 'Item 2' },
            { title: 'Item 3' },
            { title: 'Item 4' }
        ]
    });

  2. There is a config called triggerEvent that is inherited from DataViews. You can use this config to change what event fires the select event.
    Code:
    triggerEvent: 'itemtaphold',
    Here is a demo.

  3. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,135
    Answers
    129
    Vote Rating
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    You can stop the itemtap event from firing and listen for the itemtaphold event. The code would look something like this:
    Code:
    Ext.create('Ext.List', {
        fullscreen: true,
        itemTpl: '{title}',
        data: [
            { title: 'Item 1' },
            { title: 'Item 2' },
            { title: 'Item 3' },
            { title: 'Item 4' }
        ],
        listeners: {
            itemtap: function(list, index, target, record, event){
                event.stopEvent();
            },
            itemtaphold: function(list, index, target, record){
                 Ext.Msg.alert('itemtaphold event<br> fired at index: ' + index);
            }
        }
    });
    Here is a demo.

  4. #3
    Sencha User
    Join Date
    Dec 2012
    Location
    Bangalore India
    Posts
    6
    Vote Rating
    0
    tntv33 is on a distinguished road

      0  

    Default


    Hi Jerome,

    Thank you for the reply.

    The problem here is when there is a single tap, the item still gets selected. I dont want this to happen. If i use disableSelection = true. Selection of the list item wont happen at all (Either itemtap or itemtaphold). I need selection to happen only on ItemTaphold.

  5. #4
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,135
    Answers
    129
    Vote Rating
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    There is a config called triggerEvent that is inherited from DataViews. You can use this config to change what event fires the select event.
    Code:
    triggerEvent: 'itemtaphold',
    Here is a demo.

  6. #5
    Sencha User
    Join Date
    Dec 2012
    Location
    Bangalore India
    Posts
    6
    Vote Rating
    0
    tntv33 is on a distinguished road

      0  

    Default


    Thanks Jerome. That works. Exactly what i was looking for. I dint realise this configuration was there.

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