1

我有一个必需的依赖组合框。当父组合框值被选中时,从属组合被清除并重新加载存储。如何在重新加载期间不显示 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
            }),
4

2 回答 2

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();
    }
}
于 2012-06-08T18:39:46.193 回答
1

我没有确切的代码,但有一些方法可以让其他听众保持沉默 - 有关 stopEvent 和 stopPropogation,请参阅文档。

于 2012-06-05T21:47:05.387 回答