我有一个必需的依赖组合框。选择父组合框值后,将清除相关组合并重新加载存储。如何在重新加载期间显示ExtJs验证错误?
new Ext.form.ComboBox({
id: 'ddlMake',
store: makeStore,
displayField: 'Description',
valueField: 'TypeCode',
width: 110,
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText: 'Select a make',
selectOnFocus: true,
allowBlank: false,
listeners:
{
select: function (combo, record, index) {
var selVal = Ext.getCmp('ddlMake').getValue();
var modelCombo = Ext.getCmp('ddlModel');
modelCombo.setValue('');
modelCombo.store.reload({
params: { categoryTypeCode: 'MODEL', subCategoryTypeCode: selVal }
});
}
}
}),
new Ext.form.ComboBox({
id: 'ddlModel',
store: modelStore,
displayField: 'Description',
valueField: 'TypeCode',
width: 110,
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText: 'Select a model',
selectOnFocus: true,
allowBlank: false
}),
答案 0 :(得分:3)
Reset()方法将清除所有验证消息。以下是我最终使用的内容:
function LoadModelCombo(combo, record, index) {
var selVal = Ext.getCmp('ddlMake').getValue();
if (selVal != '') {
var modelCombo = Ext.getCmp('ddlModel');
modelCombo.setValue('');
modelCombo.store.reload({
params: { categoryTypeCode: 'MODEL', subCategoryTypeCode: selVal }
});
modelCombo.reset();
}
}
答案 1 :(得分:1)
我没有确切的代码,但有一些方法可以让其他听众保持沉默 - 请参阅stopEvent和stopPropogation的文档。