开发者

extjs combo box

开发者 https://www.devze.com 2023-03-03 01:46 出处:网络
I want to know that how in extjs combo box i can search for a value.like if i have entered \'a\' then a list of items starting with a must be displayed and the item selector should select if it matche

I want to know that how in extjs combo box i can search for a value.like if i have entered 'a' then a list of items starting with a must be displayed and the item selector should select if it matches with 'a' i have tried a lot but did not got anything related here is my code:

var account_details_store = new Ext.data.Store({
   id:'acs_store',
   reader: new Ext.data.JsonReader({
   totalProperty: 'count',
   fields: [{
            name: 'accountid',
            mapping: 'accountid'
        },
        {
            name: 'accountname',
            mapping:'accountname'
        },
        {
            name: 'address',
            mapping:'address'
        },
        {
            name: 'city',
            mapping: 'city'
        },
        {
            name: 'contactnum',
            mapping: 'contactnum'
        }],
        // fields: ['accountid','accountname','address','city','contactnum'],
        root: 'rows'
    }),
    proxy: new Ext.data.HttpProxy({
        url: 'accountdetailscombo.php'
    }),
    autoLoad:true
});
xtype: 'combo',
fieldLabel: 'Account details',
store:account_details_store,
valueField: 'accountid',
displayField:'accountname',
forceSelection:true,
typeAhead: false,
loadingText: 'Searching...',
emptyText: 'Type the first characters of the name',
minChars: 1,
anchor: '100%',
pageSize: 0,
hideTrigger:true,
editable: true,
triggerAction: 'all',
width: 280,
height:250,
tpl: tpl,
itemSelector: 'div.combo-result-i开发者_高级运维tem',
onSelect: function(record) {        
    this.setValue(record.data.accountname);
    this.collapse();
   // Ext.getCmp('acs_store')
}


try this in combo box

        typeAhead       : true
        ,mode           : 'remote'

check this : typeAhead For ComboBox

0

精彩评论

暂无评论...
验证码 换一张
取 消