EXTJS7 構造函數constructor中的config
小編:管理員 375閱讀 2022.09.07
extjs組件的構造函數可以獲得兩個config變量
constructor: function (config) { this.config this.callParent([config]); },復制
- 傳入參數config:實例化組件時傳入的配置參數
- 成員變量this.config: 組件類定義中的配置值 例如:
Ext.define('mybasecomp',{ config: {myBaseProp: 'defaultBasePropValue'}, constructor: function(config){ config; // 值為 {myProp: 'propValue'} this.config; // 值為 {myProp: 'defaultPropValue', myBaseProp: 'basePropValue', __proto__: {myBaseProp: 'defaultBasePropValue'}} ... } }); Ext.define('mycomp',{ extend: 'mybasecomp', myBaseProp: 'basePropValue' config: {myProp: 'defaultPropValue'}, constructor: function(config){ config; // 值為 {myProp: 'propValue'} this.config; // 值為 {myProp: 'defaultPropValue', myBaseProp: 'basePropValue', __proto__: {myBaseProp: 'defaultBasePropValue'}} ... } }); Ext.create('mycomp',{ myProp: 'propValue' });復制
相關推薦
- ExtJs七(ExtJs Mvc創建ViewPort) 前言在4.1的時候,要先創建一個擴展于Ext.app.Application的類,然后用create創建它的實例來開始應用程序的。而在4.1.1,則可直接調用application方法開始執行應用程序,簡化了。調用application方法,其參數是一個配置對象,主要配置項有以下三個:name:用來…
- Hibernate Criterion 在查詢方法設計上能夠靈活的依據Criteria的特點來方便地進行查詢條件的組裝.Hibernate設計了CriteriaSpecification作為Criteria的父接口,以下提供了Criteria和DetachedCriteria.Criteria和DetachedCriteria的主要差別在于創建的形式不一樣,Criteria是在線的,所…