Tôi có một combo trông giống như http://jsfiddle.net/Q5nNV/ExtJS 4.1 Làm thế nào để chọn mục đầu tiên trong combo
mọi thứ đều tốt nhưng khi tôi tìm kiếm (đánh máy) một số văn bản như asdf
để combo box và nhấn rõ ràng nút
đó là không chọn mục đầu tiên, nó trông giống như
Đây là mã của tôi
var states = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
{"abbr":"AK", "name":""},
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AZ", "name":"Arizona"}
]
});
// Create the combo box, attached to the states data store
var combo = Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose State',
store: states,
triggerAction: 'all',
value: "AK",
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
trigger2Cls: 'x-form-clear-trigger',
onTrigger2Click: function (args) {
this.setValue("AK");
},
tpl: new Ext.XTemplate('<tpl for=".">' + '<li style="height:22px;" class="x-boundlist-item" role="option">' + '{name}' + '</li></tpl>'),
renderTo: Ext.getBody()
});
tôi muốn khi tôi bấm nút rõ ràng combo của tôi sẽ chọn mục đầu tiên (trống mục). Cách khắc phục điều đó cảm ơn
Vâng, cảm ơn bạn đó là tốt – freestyle