[CLOSED] Combo box items add

  1. #1

    [CLOSED] Combo box items add

    Hi,

    Items are not able to add in combo box store client side.
    <ext:ComboBox ID="cboTaskType" runat="server" Width="200" Editable="false">
    </ext:ComboBox>
    
    
    var taskStore = Ext.getCmp('cboTaskType').getStore();
    taskStore.removeAll();
    
    taskStore.add(new Ext.data.Record({ text: "test1", value: 1 }));
    taskStore.add(new Ext.data.Record({ text: "test2", value: 3 }));
    
    Ext.getCmp('cboTaskType').setValue('1');
    Above code sample works in ext 1.x version
    Last edited by Daniil; Aug 20, 2014 at 11:46 AM. Reason: [CLOSED]
  2. #2
    Hi

    Please see the following sample
    http://examples2.ext.net/#/Form/ComboBox/Items_Actions/
    Vladimir Shcheglov
    Sr. Developer
  3. #3

    Remove selected item from combo box client side.

    Hi,

    We were using the below mentioned code part to remove the selected item from a combobox in 1x version.

    cmb_Template.store.remove(cmb_Template.store.getAt(cmb_Template.getSelectedIndex()));
    The sample code is not working in ext 2x version which returns the error as getselectedIndex() is undefined!

    Note: Please provide us the needed in client side.

    Please guide us!!!
  4. #4
    Please use this code to get an index of selected record.
    var index; 
    
    App.ComboBox1.findRecordByValue(App.ComboBox1.getValue()),
    index = App.ComboBox1.getStore().indexOf(record);
  5. #5
    Also, deleting selected record is demonstrated in already mentioned online example (see clear trigger handler)
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. [CLOSED] Combo box Set Selected items - Razor
    By MTSI in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Sep 07, 2012, 3:39 PM
  2. [CLOSED] [1.3] Duplicate Items on Combo
    By MP in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 18, 2012, 5:18 PM
  3. [CLOSED] space in combo items
    By Vasudhaika in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 12, 2011, 6:25 AM
  4. [CLOSED] Add Combo items
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 23, 2010, 1:00 PM
  5. Combo items not showing in FormLayout
    By myron in forum 1.x Help
    Replies: 3
    Last Post: Jun 25, 2009, 1:01 AM

Posting Permissions