案例
extjs版本: 7 modern
items:[{
xtype: 'grid',
itemConfig: {
viewModel: {},
controller: {}
},
columns: [{
renderer: 'clmnRenderer'
}]
}],
...
controller: {
clmnRenderer: function(value){return value;}
}
此案例中renderer绑定无效,报错提示
Uncaught Error: No method named "clmnRenderer" on Ext.app.ViewController
解析
由于grid实现了itemConfig,导致renderer的scope由视图controller变成了itemConfig.controller,从而引发绑定失效