1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Bangalore, India
    Posts
    139
    Answers
    2
    Vote Rating
    1
    shaleen is on a distinguished road

      0  

    Default Answered: selectfield

    Answered: selectfield


    In view
    {
    xtype: 'selectfield',
    name: 'options',
    id:'queue',
    labelWidth:'50%',
    options: [
    {text: 'ALL', value: 'all'},
    ]
    }

    in controller
    var x ='one';
    How can i add 'one' in selectfield as text:'One', value:'one'

  2. After the select field has been created, you will need to mess with the store not the options.

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


    Add it to the options config
    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.

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Location
    Bangalore, India
    Posts
    139
    Answers
    2
    Vote Rating
    1
    shaleen is on a distinguished road

      0  

    Default


    {
    xtype: 'fieldset',
    title: '<font color="#000">'+'Incident Queue',
    items: [{
    xtype: 'selectfield',
    name: 'options',
    id:'queue',
    labelWidth:'50%',
    options: [
    {text: 'R1', value: '1'},
    {text: 'R2', value: '2'},
    {text: 'R3', value: '3'}
    ],
    listeners: {
    activate: function () {
    var hello=this.getOptions();
    alert("hii"+hello[0].value); // 1 is output that is correect
    hello[3].setOptions([
    {text: 'R4', value: '4'},
    ]);
    }
    },
    }]
    },
    Still can't add to slect field
    Uncaught TypeError: Cannot call method 'setOptions' of undefined

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


    After the select field has been created, you will need to mess with the store not the options.
    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.

Thread Participants: 1