1. #1
    Sencha User riyaad's Avatar
    Join Date
    Jul 2011
    Location
    Cape Town
    Posts
    240
    Answers
    6
    Vote Rating
    1
    riyaad is on a distinguished road

      0  

    Default Answered: Store loaded selectfield listener issue

    Answered: Store loaded selectfield listener issue


    Hi guys

    I have a selectfield loaded by means of a store. Is there anyway of printing the before and after selected values to ...lets say a window.alert?

    Code:
                        xtype: 'fieldset',
                        title: 'and like...',
                        defaults: {
                            xtype: 'selectfield',
                            labelAlign: 'left',
                            labelWidth: labelwidth,
                            userClearIcon: true
                        },
                        items: [
                            {
                                label: 'Bouquet:',
                                name: 'bouquet',
                                valueField: 'bouquet_value',
                                displayField: 'bouquet_name',
                                store: bouquetStore,
                                listeners: {
                                    change: function(selectfield, newValue, oldValue) {
                                        window.alert('goodbye ' + oldValue.data.value + ', hello ' + newValue.data.value)
                                    }
                                }
                            },...
    When printing oldValue.data.value and newValue.data.value, I get undefined.
    What's the correct way of doing this? Basically I'm looking for this effect.

    Thank you.
    R

  2. bouquet_value is the name of the field you want to display so try using newValue.data.bouquet_value

  3. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    11
    Answers
    1
    Vote Rating
    0
    nick.hatherill is on a distinguished road

      0  

    Default


    bouquet_value is the name of the field you want to display so try using newValue.data.bouquet_value

  4. #3
    Sencha User riyaad's Avatar
    Join Date
    Jul 2011
    Location
    Cape Town
    Posts
    240
    Answers
    6
    Vote Rating
    1
    riyaad is on a distinguished road

      0  

    Default Brilliant - thank you

    Brilliant - thank you


    Hi Nick,

    Thank you, that worked 100%

Thread Participants: 1

Tags for this Thread