setValue方法必须在组合框上调用。http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.field.ComboBox-method-setValue
需要为组合框配置商店中项目上每个项目值的字段。如果您只想选择第一个可用选项,请从商店中获取第一个商品,然后在组合框上设置其值。
var combobox = Ext.getCmp('grid-accident-voilation');
var firstItem = combobox.getStore().getAt(0);
// Optionally, get the value field programmatically.
var valueField = combobox.getInitialConfig('valueField');
combobox.setValue(firstItem.get(valueField));
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句