extjs - Combobox - Auto position in dropdown list -
i have simple combobox follows :
{ xtype: 'combobox', id: 'prd-main-group', fieldlabel: 'ana mal grubu', inputwidth: 320, labelwidth: 160, labelalign: 'right', margin: '15 0 0 0', fieldstyle: 'height: 26px; text-align: right; font-size: 12pt; color:#505050', store: articlemain, valuefield: 'whg', displayfield: 'whg_bez', querymode: 'remote', autoselect: false, selectonfocus: true, hidetrigger: true, msgtarget: 'side', triggeraction: 'all', typeahead: true, minchars: 2, listeners: { select: function (combo, selection) { articlebase.proxy.extraparams = {'maingroup': combo.getvalue()}; ext.getcmp('prd-base-group').setdisabled(false); ext.getcmp('prd-base-group').getstore().removeall(); ext.getcmp('prd-base-group').setvalue(null); ext.getcmp('prd-sub-group').getstore().removeall(); ext.getcmp('prd-sub-group').setvalue(null); articlebase.load(); }, focus: function(combo) { combo.setvalue(''); } } },
when typed 2 or more characters, combobox dropdown list appear , showing values no automatically position selected record dropdown list.
as can see attached screen shot, value completed drop down list didn't focused selected record!
my question is, when type few chars, dropdown list should automatically change based on given chars.
without skirtle's den :)
we should set autoload: true
parameter in store
definition. after should set querymode
local
. know doesn't make sense when set autoload
, data loaded store created!
{ xtype: 'combobox', id: 'prd-main-group', fieldlabel: 'ana mal grubu', inputwidth: 320, labelwidth: 160, labelalign: 'right', margin: '15 0 0 0', fieldstyle: 'height: 26px; text-align: right; font-size: 12pt; color:#505050', store: articlemain, valuefield: 'whg', displayfield: 'whg_bez', querymode: 'local', autoselect: true, forceselection: true, msgtarget: 'side', triggeraction: 'all', listeners: { select: function (combo, selection) { articlebase.proxy.extraparams = {'maingroup': combo.getvalue()}; ext.getcmp('prd-base-group').setdisabled(false); ext.getcmp('prd-base-group').getstore().removeall(); ext.getcmp('prd-base-group').setvalue(null); ext.getcmp('prd-sub-group').getstore().removeall(); ext.getcmp('prd-sub-group').setvalue(null); articlebase.load(); }, focus: function(combo) { combo.setvalue(''); } } }
and here store definition :
var articlemain = new ext.data.jsonstore({ model: 'articlemaingroup', autoload: true, proxy: { type: 'ajax', url: '<?php echo base_url() ?>create/get_product_main_group', reader: { type: 'json', root: 'articlemaingroup', idproperty: 'id' } } });
Comments
Post a Comment