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 2022-04-11 22:39  路过君  阅读(53)  评论(0编辑  收藏  举报

导航