简体   繁体   中英

In ExtJs 3 what does happen to a component after afterrender event is fired?

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? Shouldn'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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM