Extjs 链接组合 - 让父值具有相同的子值
如果父值具有唯一标识符,我已经链接了组合。 但是,我在父组合中有 4 个选项,它们对于子组合应该具有相同的值。我在商店中为它们指定了相同的标识符,但当我选择其中任何一个时,组合中的值不会改变。
有没有办法在不复制所有值的情况下做到这一点?
商店
var fields = [
["s","Name"],
["s","ID"],
["cc","City"],
["s","Cost"],
["r","Status"]
];
var operators =[
[1, "s","begins with"],
[2, "s","equals"],
[3, "s","contains"],
[4, "s","ends with"],
[5, "cc", "equals"],
[6, "r", "equals"]
];
组合
xtype:'combo',
id: 'fieldSelecCmb1',
width: 125,
displayField: 'field',
valueField: 'fid',
hideLabel: true,
store: storeField ,
triggerAction: 'all',
mode: 'local',
value: "Choose a field",
listeners:{
select: {
fn:function(combo, value){
var id = combo.id;
var rowNo = id.charAt(id.length-1);
var opCombo = Ext.getCmp("optionSelectCmb"+rowNo);
opCombo.clearValue();
opCombo.store.filter("fid", combo.getValue());
}
}
I have linked combos that work if the parent value has a unique identifier.
However, I have 4 options in the parent combo that should have the same value for the child combo. I've given these the same identifier in the store, yet the value in the combo doesn't change when I choose any of them.
Is there anyway to do this without duplicating all values?
Stores
var fields = [
["s","Name"],
["s","ID"],
["cc","City"],
["s","Cost"],
["r","Status"]
];
var operators =[
[1, "s","begins with"],
[2, "s","equals"],
[3, "s","contains"],
[4, "s","ends with"],
[5, "cc", "equals"],
[6, "r", "equals"]
];
Combo
xtype:'combo',
id: 'fieldSelecCmb1',
width: 125,
displayField: 'field',
valueField: 'fid',
hideLabel: true,
store: storeField ,
triggerAction: 'all',
mode: 'local',
value: "Choose a field",
listeners:{
select: {
fn:function(combo, value){
var id = combo.id;
var rowNo = id.charAt(id.length-1);
var opCombo = Ext.getCmp("optionSelectCmb"+rowNo);
opCombo.clearValue();
opCombo.store.filter("fid", combo.getValue());
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以改用filterBy 函数。方法如下:
You can use the filterBy function instead. Here's how: