render - ExtJS How to override onRender so that I can get correct component? -


i'm trying size of div rendered component.

ext.define('eds.view.selector.container', {     extend: 'ext.panel.panel',     alias : 'widget.selectorcontainer',      layout: 'fit',      initcomponent: function(){          this.items = [                 {                     xtype: 'tabpanel',                     defaults: {                         bodypadding: 10                     },                     layout: 'fit',                     items:[                          {                              title: 'organization',                              id: 'selector-organization',                              tag: 'div',                                                           html: 'div here',                              height: '100%',                              onrender: function(){                                  //// render d3                                 // selector                                 console.log("onrender");                                 console.log(this.height);                                 console.log(this.width);                                  var divid = ext.getcmp('selector-organization').id + "-body";                                 var divheight = ext.get(divid).getheight();                                 var divwidth = ext.get(divid).getwidth();                                 console.log(divheight);                                 console.log(divwidth);                                 renderselectororgview(divid, divheight, divwidth);                                     this.callparent();                              }, ...... ...... 

and onrender function interrupts normal render process. whole layout got corrupted , div (#selector-organization-body) small. i'm wondering if overriding onrender in wrong way.

indeed, that's broken. problem callparent , such methods available methods have been passed through ext.define.

you can emulate callparent calling parent method current scope , arguments. in case, replace this.callparent() (which missing arguments, way) line:

ext.panel.panel.prototype.onrender.apply(this, arguments); 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -