extjs树面板渲染器的问题
我想稍微修改默认的树面板渲染器。因此,在第一步中,我尝试调用默认的树面板渲染器。不幸的是,这不起作用 这是我的密码:extjs树面板渲染器的问题,extjs,extjs5,Extjs,Extjs5,我想稍微修改默认的树面板渲染器。因此,在第一步中,我尝试调用默认的树面板渲染器。不幸的是,这不起作用 这是我的密码: Ext.define('FMSGui.view.FMSFeatureTypeTreePanelColumn', { extend: 'Ext.tree.Column', dataIndex: 'name', flex:1, renderer: function(v1) { return this.callParent(v1); } } );
Ext.define('FMSGui.view.FMSFeatureTypeTreePanelColumn',
{
extend: 'Ext.tree.Column',
dataIndex: 'name',
flex:1,
renderer: function(v1)
{
return this.callParent(v1);
}
}
);
树面板的代码如下所示:
Ext.define('FMSGui.view.FMSFeatureTypeTreePanel', {
extend: 'Ext.tree.Panel',
title: 'Feature Types',
width: 200,
height: 150,
store: null,
displayColumn:null,
constructor: function(config)
{
this.displayColumn=Ext.create("FMSGui.view.FMSFeatureTypeTreePanelColumn");
this.columns=[this.displayColumn];
this.store=Ext.create("FMSGui.store.FMSFeatureTypeTreeStore");
this.store.load();
this.superclass.constructor.call(this,config);
},
rootVisible: true,
lines: true,
useArrows: true
});
我总是收到错误消息:
XTemplate求值异常:this.callParent不是函数
顺便说一句,如果我删除渲染器部分,它可以工作
知道这里出了什么问题吗?
谢谢您的评论。这是一个范围问题。在
呈现程序
的闭包中,此
不是对FMSGui.view.FMSFeatureTypeTreePanelColumn的引用(它实际上是对窗口的引用),因此没有callParent
属性
尝试阅读以下文章:
如果您描述了您想要通过实现什么,请返回此.callParent(v1)代码>我将尝试帮助您编写一些代码/小提琴。啊,非常感谢,我想在渲染器中进行国际化,因此,更改此选项。callParent(v1);callParent(translate_map[v1]);对不起,不小心点击了编辑而不是添加评论,有人可以删除我上面写的部分吗。我似乎不允许自己做这件事。没人知道吗?不幸的是,仍然无法解决它。