JavaScript Extjs - 扩展组件模板

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JavaScript Extjs - 扩展组件模板相关的知识,希望对你有一定的参考价值。

MyComponent = Ext.extend(Ext.some.component, {
    // Prototype Defaults, can be overridden by user's config object
    propA: 1,
 
    initComponent: function(){
        // Called during component initialization
 
        // Config object has already been applied to 'this' so properties can 
        // be overriden here or new properties (e.g. items, tools, buttons) 
        // can be added, eg:
        Ext.apply(this, {
            propA: 3
        });
 
        // Before parent code
 
        // Call parent (required)
        MyComponent.superclass.initComponent.apply(this, arguments);
 
        // After parent code
        // e.g. install event handlers on rendered component
    },
 
    // Override other inherited methods 
    onRender: function(){
 
        // Before parent code
 
        // Call parent (required)
        MyComponent.superclass.onRender.apply(this, arguments);
 
        // After parent code
 
    }
});
 
// register xtype to allow for lazy initialization
Ext.reg('mycomponentxtype', MyComponent);

以上是关于JavaScript Extjs - 扩展组件模板的主要内容,如果未能解决你的问题,请参考以下文章

ExtJS 4.2 Date组件扩展:添加清除按钮

Javascript - ExtJs - 基本组件

Extjs5 tree扩展----treepanel树组件

easyui和extjs哪个好

Javascript - ExtJs - Window组件

Javascript - ExtJs - TabPanel组件