1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    5
    Vote Rating
    0
    balaram_reddy is on a distinguished road

      0  

    Default Unanswered: How to make the combobox act like simple dropdown

    Unanswered: How to make the combobox act like simple dropdown


    While the combo box is rich and provides various features, how can I make it act like simple dropdown. I tried to set typeAhead as false, editable as false. However this still is not close the the old dropdown where I can get to a value in dropdown by just key press. Are there any other settings to make this combo box act like a straight <select> tag?

  2. #2
    Sencha User poojagarg89's Avatar
    Join Date
    Sep 2011
    Location
    Ahmedabad,India
    Posts
    213
    Vote Rating
    0
    poojagarg89 is on a distinguished road

      0  

    Default


    Code:
    items:[{
                flex: 1,
              xtype:'combo',
              id:"user_role_99",
              fieldLabel:"Role",
              mode:'local',
              allowBlank:false,
              blankText:"This field is required",
              msgTarget:"under",
              triggerAction:'all',
              store: roleId_store,                //roleId_store is the store name that u wanna show in combobox
              displayField:'role_id',
              valueField:"role_id",
              emptyText:"Select Text..."
            }]
    try with this configs...

  3. #3
    Sencha User radjabek's Avatar
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
    radjabek is on a distinguished road

      0  

    Default I have some code , try this

    I have some code , try this


    controls.ISACTIVE = Ext.create('Ext.js.override.ComboBox',{
    fieldLabel : "State",
    name : "state",
    width: 150,
    storeData : [{'CODE':'0', 'NAME':'Active'}, {'CODE':'1', 'NAME':'Passive'}]
    });

    But for use this code you must have my ovveride class.. This ComboBox like to simple DropDown
    If you don't want use ovveride class, you must copy features to your ComboBox that enough

  4. #4
    Sencha User radjabek's Avatar
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
    radjabek is on a distinguished road

      0  

    Default ComboBox override class for my example

    ComboBox override class for my example


    Ext.define('Ext.js.override.ComboBox',{
    extend: 'Ext.form.field.ComboBox',
    typeAhead: false,
    selectOnFocus: false,
    forceSelection: true,
    editable: false,
    emptyText: '-',
    queryMode: 'local',
    minChars: 1,
    triggerAction: 'all',
    alueField: 'CODE',
    displayField: 'NAME',
    storeData: null,
    storeFields: ['CODE', 'NAME'],
    initComponent: function(){
    var me = this;
    var store;
    if(Ext.isArray(me.storeData)){
    store = Ext.create('Ext.data.Store',{
    fields: me.storeFields,
    data: me.storeData
    });
    }

    Ext.apply(me, {
    store: store,
    });

    me.callParent();
    }

    });

  5. #5
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,605
    Answers
    543
    Vote Rating
    326
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    See this thread:

    http://www.sencha.com/forum/showthre...002#post681119

    Near the end I posted some code for keypress jumping to values in the drop-down. It sounds to me like that's what you're looking for.