0
votes

I would like to slightly modify the default tree panel renderer. So in the first step, I try to just call the default tree panel renderer. Unfortunately, this doesnt work.

Here is my code:

Ext.define('FMSGui.view.FMSFeatureTypeTreePanelColumn',
{
  extend:   'Ext.tree.Column',
  dataIndex: 'name',
  flex:1,
  renderer: function(v1)
  {
      return this.callParent(v1);
  }
}
);

The code for the TreePanel looks as follows:

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 
    });

I always get the error message:

XTemplate evaluation exception: this.callParent is not a function

It works by the way, if I remove the renderer part.

Any idea what goes wrong here? Thanks for any remarks.

1
noone else any idea? Still could not solve it unfortunately.Ulli

1 Answers

0
votes

Its a scope issue. In renderer's closure this is not reference to FMSGui.view.FMSFeatureTypeTreePanelColumn (its actually reference to a window), thus there is no callParent property.

Try to read this articles: Closures, this keyword

If you describe what exactly you want to achieve with return this.callParent(v1); ill try to help you wtih some code / fiddle.