如何使用EXT5组合框与数据绑定 [英] How to use Ext5 combobox with data bindings
本文介绍了如何使用EXT5组合框与数据绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用它从数据绑定也是可能的选项从接收数据的同店结合的preselected值的组合框。
该面板项目的配置是这样的:
I want to use a combobox which receives the preselected value from a data binding and also the possible options from a data binding of the same store. The panel items configuration looks like this:
{
xtype: 'combobox',
name: 'language_default',
fieldLabel: 'Default Language',
multiSelect: false,
displayField: 'title',
valueField: 'language_id',
queryMode: 'local',
bind: {
value: '{database.language_default}',
store: '{database.languages}'
}
}
如果我用这个配置,组合框的存储是无效的,unuseable。
If I use this configuration, the store of the combobox is invalid and unuseable.
是否有可能为绑定的选择的选项的和也可用选项的的组合框
Is it possible to bind the selected option and also the available options of a combobox?
推荐答案
升级到5.0.1 ExtJS的,你可以使用的选择结合
Upgrade to ExtJs 5.0.1 and you can use selection binding
{
xtype: 'combobox',
name: 'language_default',
fieldLabel: 'Default Language',
multiSelect: false,
displayField: 'title',
valueField: 'language_id',
queryMode: 'local',
bind: {
value: '{database.language_id}',
selection: '{database.language_default}',
store: '{database.languages}'
}
}
这篇关于如何使用EXT5组合框与数据绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文