开发者

getInnerHeight and getInnerWidth in ExtJS4

开发者 https://www.devze.com 2023-03-19 22:25 出处:网络
We are using getInnerHeight and getInnerWidth methods in our application.Now we a开发者_运维知识库re migrating to ExtJS4. As per my Observation, these two methods are not there for panel.

We are using getInnerHeight and getInnerWidth methods in our application.Now we a开发者_运维知识库re migrating to ExtJS4. As per my Observation, these two methods are not there for panel.

Is there any thing replaces these two methods?


if you need the body width/height(without header, dockeditems etc...)try this:

var height = Ext.getCmp('panelId').body.getHeight(true);


Why are you using innerHeight and innerWidth? You can get the height/width of the element that the Ext.Panel is rendered to as follows...

var height = Ext.getCmp('panelId').getEl().getHeight();

This should suffice unless you've got massive amounts of padding on your panel.


Pass boolean true as parameter for the getHeight() function. So you get:

var height = Ext.getCmp('panelId').getEl().getHeight(true);
0

精彩评论

暂无评论...
验证码 换一张
取 消