如何使用Ext5组合框与数据绑定 [英] How to use Ext5 combobox with data bindings
本文介绍了如何使用Ext5组合框与数据绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用从数据绑定接收预选值的组合框,以及同一商店的数据绑定中的可能选项。
面板项配置如下所示:
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}'
}
}
如果我使用这个配置,组合框的存储是无效的,不能使用。
If I use this configuration, the store of the combobox is invalid and unuseable.
选择
推荐答案
升级到ExtJs 5.0.1,您可以选择组合框可以使用选择绑定
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屋!
查看全文