具有2个相同显示值的ExtJS组合框不会更改select上的值
||
我有一个填充有地址列表的组合框:
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,而不是新选择的。
我是否有规则未知,即使两个之间的valueField是唯一的,也无法阻止组合框的两个记录具有相同的displayField设置?
还是我想念其他东西?
没有找到相关结果
已邀请:
2 个回复
呸溉
如果需要对可选字段(例如地址2)执行条件操作,则也可以将三元运算符等嵌套在此字段中。
玩翁文醚碱
。这就是商店用来唯一标识其包含的记录的工具。