In my ExtJs 3 app I have a ListView component that sits inside a Window with layout 'fit'.
Right after afterrender event of ListView is fired I check that el element referenced by that ListView has height of 200. But if I defer that height checking by 1ms (and therefore let some other ExtJs stuff to happen) the height of ListView's el is different (370 in my case).
So what does happen with ListView's el height after afterrender is fired? Sh开发者_JAVA百科ouldn't afterrender be fired after all everything is settled?
Im not sure how to answer your question. but maybe you could try the afterLayout
event of the Window and see if this works. Im not sure it will though?
"Afterrender
" is called once the component is rendered. It has nothing to do with data - so, even if the data inside that list isn't rendered, afterrender will be called. So, may be you got two heights because data was just still rendering.
Afterrender event from API Doc:
The afterrender event is fired after this Component has been {@link #rendered}, been postprocesed by any afterRender method defined for the Component, and, if {@link #stateful}, after state has been restored.
精彩评论