Results 1 to 3 of 3

Thread: ComboBox, Store from simple one-dim array

  1. #1
    Sencha Premium Member
    Join Date
    Sep 2014
    Posts
    81
    Answers
    1

    Default Answered: ComboBox, Store from simple one-dim array

    The simple things seems to be the best brain tester:

    I have a combobox and a one-dim. array with strings and these strings should be shown in the comboxbox. If you have a static reference of that array - everything is simple:

    {
    xtype: 'combobox'
    store: [ 'Foo', 'Bar' ]
    }

    and the stuff is shown - ok. But now I want to reference that array from the ViewModel ...

    {
    xtype: 'combobox'
    store: '{simpleArray}'
    }

    is not working, because it assumes, that '{simpleArray}' references a store - but that is not true.

    Any simple idea ?

  2. You forgot to enclose the store declaration in the second sample in a "bind" config. Here you have a working sample based on your requirements:

  3. #2

    Join Date
    Feb 2011
    Location
    Chisinau, Moldova
    Posts
    316
    Answers
    64

    Default

    You forgot to enclose the store declaration in the second sample in a "bind" config. Here you have a working sample based on your requirements:

  4. #3
    Sencha Premium Member
    Join Date
    Sep 2014
    Posts
    81
    Answers
    1

    Default

    Thanks !

Similar Threads

  1. Load a VERY SIMPLE string array in store
    By jksuf in forum Ext 5: Q&A
    Replies: 4
    Last Post: 10 Apr 2017, 4:58 AM
  2. Populating a ComboBox using a simple array of strings
    By pablo72 in forum Ext: Discussion
    Replies: 6
    Last Post: 30 Mar 2014, 5:30 AM
  3. Replies: 2
    Last Post: 13 Jul 2011, 5:12 AM
  4. Replies: 1
    Last Post: 2 Apr 2011, 10:42 PM
  5. Local array to Simple Store
    By ks2009 in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 11 Mar 2011, 1:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •