|
@@ -12,6 +12,7 @@ import initRows from './controls/rows'
|
|
import initCols from './controls/cols'
|
|
import initCols from './controls/cols'
|
|
import initButton from './controls/button'
|
|
import initButton from './controls/button'
|
|
import initStores from './controls/stores'
|
|
import initStores from './controls/stores'
|
|
|
|
+import {lookupFn, lookupScope} from "./lib/lib";
|
|
|
|
|
|
export function init() {
|
|
export function init() {
|
|
// 引入 filters 过滤插件
|
|
// 引入 filters 过滤插件
|
|
@@ -63,13 +64,19 @@ export function init() {
|
|
*/
|
|
*/
|
|
const _doAddListener = Ext.mixin.Observable.prototype.doAddListener
|
|
const _doAddListener = Ext.mixin.Observable.prototype.doAddListener
|
|
Ext.mixin.Observable.prototype.doAddListener = function (ename, fn, scope, options, order, caller, manager) {
|
|
Ext.mixin.Observable.prototype.doAddListener = function (ename, fn, scope, options, order, caller, manager) {
|
|
- if (typeof fn === 'string' && _.startsWith(fn, 'scope.')) {
|
|
|
|
|
|
+ if (typeof fn === 'string' &&
|
|
|
|
+ (_.startsWith(fn, 'scope.') ||
|
|
|
|
+ _.startsWith(fn, 'system.') ||
|
|
|
|
+ _.startsWith(fn, 'format.')
|
|
|
|
+ )) {
|
|
// console.log('doAddListener', ename, fn, scope, options, order, caller, manager)
|
|
// console.log('doAddListener', ename, fn, scope, options, order, caller, manager)
|
|
- const vm = this.lookupViewModel()
|
|
|
|
- if (vm && vm.yvanScope) {
|
|
|
|
- scope = vm.yvanScope
|
|
|
|
- fn = scope[fn.substr('scope.'.length)]
|
|
|
|
- }
|
|
|
|
|
|
+ // const vm = this.lookupViewModel()
|
|
|
|
+ // if (vm && vm.yvanScope) {
|
|
|
|
+ // scope = vm.yvanScope
|
|
|
|
+ // fn = scope[fn.substr('scope.'.length)]
|
|
|
|
+ // }
|
|
|
|
+ scope = lookupScope(this)
|
|
|
|
+ fn = lookupFn(scope, fn)
|
|
}
|
|
}
|
|
|
|
|
|
_doAddListener.call(this, ename, fn, scope, options, order, caller, manager)
|
|
_doAddListener.call(this, ename, fn, scope, options, order, caller, manager)
|