2个相同的显示值不变化的值:当膨胀时ExtJS的组合框与我有一个组合框,与地址的列表填充上选择
this.entityAddressField = new Ext.form.ComboBox(
{
id: 'entityAddressField',
fieldLabel: 'Address',
store: entityAddressStore,
mode: 'local',
width: 250,
valueField: 'entity_address_id',
displayField: 'address_type',
tpl: new Ext.XTemplate(
'<tpl for="."><div class="search-item">',
'<p><b>{address_type}</b></p>',
'<p>{address_1}</p>',
'<p>{address_2}</p>',
'<p>{city}, {state_code} {zipcode}</p>',
'</div></tpl>'
),
itemSelector: 'div.search-item',
hidden: true,
triggerAction: 'all',
listeners: {
select: function(combo, record, index) {
me.entityAddressDisplay.update(address_template.apply(record.data));
me.entityAddressDisplay.show();
}
}
});
的列表显示的完整地址,但一旦选择的组合框仅将显示displayField,这是地址类型(家庭,工作等)。
在这种情况下这两个“家庭”地址列(同一类型,但不同的地址),如果我改变从一个“家”的地址组合框其他 - 美其名曰:
this.entityAddressField.getValue();
将返回最初选择的项目的entity_address_id,而不是新选择的项目。
是否有我不知道的规则,即使两个值之间的值域是唯一的,防止组合框具有相同的displayField设置的两个记录?
还是我失去了什么东西?
如果我的理解正确,这个动态字段将不得不被用作组合框的displayField以便工作? – Keylan 2011-05-13 16:20:04