Browse Source

GRID renderer

liuzhuang 3 years ago
parent
commit
d29d58c0b1
1 changed files with 17 additions and 0 deletions
  1. 17 0
      src/controls/grid.js

+ 17 - 0
src/controls/grid.js

@@ -102,6 +102,23 @@ export default function () {
                 }
                 }
             }
             }
 
 
+            _.each(newConfig.columns, c => {
+                const {renderer} = c
+                if (typeof renderer === 'string' && (
+                    _.startsWith(renderer, "scope.") ||
+                    _.startsWith(renderer, "system."))
+                ) {
+                    if (newConfig.$initParent) {
+                        // 在面板上的组件
+                        const scope = newConfig.$initParent.lookupReferenceHolder().yvanScope;
+                        if (scope) {
+                            const rendererFn = lookupFn(scope, renderer)
+                            c.renderer = rendererFn
+                        }
+                    }
+                }
+            })
+
             this.superclass.constructor.call(this, newConfig)
             this.superclass.constructor.call(this, newConfig)
         },
         },