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

      0  

    Question Answered: how to add event listener for a item like select field in sencha touch

    Answered: how to add event listener for a item like select field in sencha touch


    hi all,
    i have one item like this
    Code:
    items:[{ xtype: 'selectfield',
    						id:'sector',
                            name : 'mode',
                            label: 'Sector',
                            valueField : 'mode',
                            displayField : 'title', 
                            store : sectorStore,						
    						}]
    Now if i want to add a listener to that item what i have to do.
    whenever change is made in that item i wan to perform some action for that how can we do?

  2. If you check the API there is a "change" event that is fired just before the value is changed



    change
    ( Ext.form.Text this, Mixed newValue, Mixed oldValue )

    Fires just before the field blurs if the field value has changed.
    Parameters

    • this : Ext.form.TextThis field
    • newValue : MixedThe new value
    • oldValue : MixedThe original value

  3. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,169
    Vote Rating
    28
    Answers
    83
    jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough

      0  

    Default


    The API describes the events for this type of input field.

    Have you checked it?

    Jay Garcia @ModusJesus || Modus Create co-founder
    Ext JS in Action author
    Sencha Touch in Action author

    Get in touch for Ext JS & Sencha Touch Touch Training

    We are also working on Video-based Sencha Touch training: Check it out here.

  4. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    Mumbai, India
    Posts
    115
    Vote Rating
    3
    Answers
    11
    Sasha172 is on a distinguished road

      0  

    Default


    If you check the API there is a "change" event that is fired just before the value is changed



    change
    ( Ext.form.Text this, Mixed newValue, Mixed oldValue )

    Fires just before the field blurs if the field value has changed.
    Parameters

    • this : Ext.form.TextThis field
    • newValue : MixedThe new value
    • oldValue : MixedThe original value

Tags for this Thread