PDA

View Full Version : Getting this/parent object in property defining



Luixo
21 May 2013, 12:33 AM
Hello,

I have a grid, in which i insert a toolbar (by dockedItems). Toolbar is created nearby by

var Toolbar = Ext.create('Ext.toolbar.Toolbar',{ ... });
How can i point from Toolbar to grid using property-defining syntax? Like this:

var Toolbar = Ext.create('Ext.toolbar.Toolbar', {
parentGrid: this.up(),
});
and parentGrid should return grid object in which i inserted the toolbar.
Thanks in advance.

tvanzoelen
21 May 2013, 12:45 AM
Probably up() only works when the tb is rendered.

So do it when the toolbar is rendered.

Luixo
21 May 2013, 2:01 AM
Maybe there is another way to get parent option before render?

tvanzoelen
21 May 2013, 2:24 AM
var Toolbar = Ext.create('Ext.toolbar.Toolbar', {
parentGrid: this.ownerCt
});