Results 1 to 3 of 3

Thread: Adding a string to a combo box

  1. #1
    Ext JS Premium Member
    Join Date
    May 2010
    Posts
    1

    Default Adding a string to a combo box

    Hi, I'm trying to simply add a text string to a combo box and am getting very confused by the API documentation regarding Stores, Records, and ArrayReaders. What I want is a combo box that just holds user names and can be added to with the click of a button.

    Code:
    var pplStore = new Ext.data.ArrayStore({
        fields: ['userId']         // ArrayStore initially empty.
    });
    ...
    // Combo box definition, placed somewhere on the page
    {                            
        xtype: 'combo',
        store: pplStore,
        displayField: 'userId',
        mode: 'local',
        id: 'cboSearchType',
        name: 'cboSearchType',
        editable: false,
        triggerAction: 'all',
        selectOnFocus:true,
        emptyText:'None Added',
        allowBlank: true,
        fieldLabel: "Search Type",
        anchor: '95%'
    }
    ...
    function addUserName(userName) {
       // What goes here?  I know that ArrayStore has an add function but
       // I cannot figure out how to properly construct the Record objects 
       // unfortunately (I have read all the docs already).
    }
    ...
    // Called by some user event on the page.
    addUserName("ScoobyDoo");
    Thanks so much for any help you can provide!

    Derek

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    ComboBoxes are not part of Ext Core.

    Moving thread...

  3. #3
    Ext JS Premium Member
    Join Date
    Jan 2010
    Location
    Austria
    Posts
    87
    Mark solved threads with [SOLVED]... this saves a lot of time

Similar Threads

  1. adding a label after the combo box
    By rjanos in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 24 Mar 2009, 12:17 PM
  2. Problem in adding data to combo box
    By sathishs in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 25 Feb 2008, 8:27 PM
  3. Replies: 6
    Last Post: 4 Dec 2007, 12:32 PM
  4. Adding a blank row to the combo box
    By dee_rocks in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 28 Sep 2007, 1:19 PM

Posting Permissions

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