1. #1
    Sencha User davisty's Avatar
    Join Date
    Mar 2010
    Location
    Spanish Fort, Al
    Posts
    270
    Answers
    11
    Vote Rating
    1
    davisty is on a distinguished road

      0  

    Default Answered: How to add longpress event to text field?

    Answered: How to add longpress event to text field?


    Hello,

    Im trying to add a longpress event to a text field, but it's not firing.

    What am I doing wrong.

    Code:
     items: [                                        
                        {                                       
                          xtype: 'textfield',                   
                          name : 'SCSCOD',                      
                          id   : 'SCSCOD',                      
                          value:  SCSCOD,                       
                          label: 'Shipper Code',                
                          useClearIcon: true,                   
       listeners: {                                             
                   longpress: function() {                            
                   alert('touched this');                       
                             }                                  
                        }                                       
                        },{

  2. Something like:

    Code:
    new Ext.form.FormPanel({
        fullscreen : true,
        items      : [
            {
                xtype     : 'textfield',
                label     : 'Test',
                listeners : {
                    element : 'el',
                    taphold : function() {
                        console.log('tap');
                    }
                }
            }
        ]
    });

  3. #2
    Sencha User davisty's Avatar
    Join Date
    Mar 2010
    Location
    Spanish Fort, Al
    Posts
    270
    Answers
    11
    Vote Rating
    1
    davisty is on a distinguished road

      0  

    Default


    Ps. I cant get any event to fire at all. Am I able to put a listener on a textfield?

    Thank You ...

  4. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,780
    Answers
    3465
    Vote Rating
    833
    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


    longpress is on the element not the component itself.
    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.

  5. #4
    Sencha User davisty's Avatar
    Join Date
    Mar 2010
    Location
    Spanish Fort, Al
    Posts
    270
    Answers
    11
    Vote Rating
    1
    davisty is on a distinguished road

      0  

    Default


    Im not sure what that means. Can you give me an example, please.

  6. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,780
    Answers
    3465
    Vote Rating
    833
    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


    Something like:

    Code:
    new Ext.form.FormPanel({
        fullscreen : true,
        items      : [
            {
                xtype     : 'textfield',
                label     : 'Test',
                listeners : {
                    element : 'el',
                    taphold : function() {
                        console.log('tap');
                    }
                }
            }
        ]
    });
    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.

  7. #6
    Sencha User davisty's Avatar
    Join Date
    Mar 2010
    Location
    Spanish Fort, Al
    Posts
    270
    Answers
    11
    Vote Rating
    1
    davisty is on a distinguished road

      0  

    Default


    That worked but I dont understand the difference.

    I had used element: 'element', and it didnt work

    Thank You very much ...

  8. #7
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,780
    Answers
    3465
    Vote Rating
    833
    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


    element : 'element' is the ST 2 way of listening on the element, in ST 1, it's just 'el'. Think of it as a property on the component (not really as such but will work mostly)
    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.

  9. #8
    Sencha User davisty's Avatar
    Join Date
    Mar 2010
    Location
    Spanish Fort, Al
    Posts
    270
    Answers
    11
    Vote Rating
    1
    davisty is on a distinguished road

      0  

    Default


    coolBeans ...

    You da man Mitch

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi