简体   繁体   中英

Extend platformConfig property of Ext.form.Panel

I'm trying to overide a global platformConfig of a Ext.form.Panel class.

I'm trying to do this to avoid defining the same platFormConfig on every view that is extending Ext.form.Panel. I'm trying to avoid to create a intermediate baseclass like My.form.Panel just for adding a platformConfig property.

What I've tried so far:

Ext.form.Panel.addMember('platformConfig',  [{
        platform: ['windows'],
        scrollable: 'vertical'
}]);

But this doesn't apply to the inherited view classes. Is there a clean solution for extending a Ext/Sencha base class?

Thanks in advance - any help is appreciated!

Well, to override, I would use override :

Ext.define('MyOverride',{
    override:'Ext.form.Panel', // <- this is an override!
    platformConfig:{
        ...
    }
});

The override definition should take place either in Ext.onReady or in the application init method.

This would then apply to inherited view classes as well - unless the platformConfig is overridden there again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM