在 GeoExt 2 中,我有一个包含一个字段和 2 个单选按钮的表单。我编写了单选按钮来更改该字段的名称以符合 GeoExt 的约定。
items: [
{
xtype: "numberfield",
itemId: 'parcel',
name: 'parcelAtt__ge',
fieldLabel: 'Parcel Number:'
},
{
xtype: 'radiogroup',
fieldLabel: 'Search type:',
columns: 2,
vertical:true,
items: [
{
boxLabel: 'greater than',
name: 'option',
inputValue: '1',
submitValue: false,
checked: true,
listeners: {
change: function (field, newValue, oldValue) {
if (newValue) myPanel.down('#parcel').inputEl.dom.name = 'parcelAtt__ge';
}
}
},
{
boxLabel: 'lower then',
name: 'option',
inputValue: '2',
submitValue: false,
listeners: {
change: function (field, newValue, oldValue) {
if (newValue) myPanel.down('#parcel').inputEl.dom.name = 'parcelAtt__le';
}
}
},
]
}
],
我可以确认(通过 Firebug)上面的代码更改了 HTML 中的字段名称,但是在提交表单时,GeoExt 在设置 OpenLayers 过滤器时不使用新的字段名称。
任何提示或解决方案?