EXTJS grid.column.renderer绑定失效

案例

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,从而引发绑定失效

posted on 2020-08-07 10:14  路过君  阅读(92)  评论(0编辑  收藏  举报

导航