-
29 Jul 2010 1:37 AM #1
panel 'afterrender' is not working
panel 'afterrender' is not working
hello.
Can you please help me.
I try add Listener to panel, but it is not working
I have a panel :
And I try add listener to itCode:var panelBody = this.getEl().child('.x-panel-body');
But nothing happensCode:panelBody.on('afterrender', function() { alert(1);} , this);
And this
is not working, tooCode:Ext.EventManager.on(panelBody, 'afterrender', function() { alert('afterrender ! '); });
-
29 Jul 2010 1:39 AM #2
If you add the listener after it has rendered, the event won't get fired again.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
29 Jul 2010 1:42 AM #3
-
29 Jul 2010 1:48 AM #4
ok, then, I have another question
How can I know, when All content was add to the panel ?
'afterrender' alert before loaded all content in the panel
-
29 Jul 2010 2:47 AM #5
You might be thinking of the afterlayout event.
You will need to use {single: true} to only catch the first layout event.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
29 Jul 2010 4:38 AM #6
no, but in any case, thank you, mr. Animal !
It seems, that I have to use defer() function, I know, that it's bad solution. But I really do not uderstand, how can I catch event, when all content will innerHTML to the panel, with all css ...

-
29 Jul 2010 4:44 AM #7
Oh, you are not using the Panel as a Container then, but dumping some dead HTML into it?
You don't need events then. Just perform postprocessing after you've dumped the HTML in.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
29 Jul 2010 5:36 AM #8
thank you, mr.Animal !!
How do you think, is it possible or not ?
I have a panel. panel, and I do innerHTML to it
and then (on the next line) I try to get offsetTop of one element from that panel. But calculate is wrong. But, if I use defer() function or just alret('bla bla bla') - calculate is right !Code:panel.update(some_html);
For example
Wrong offset:
Right offsetCode:panel.update(some_html); alert(Ext.get('id9').dom.offsetTop); // this offset is wrong !!! It is 2100
Right offsetCode:panel.update(some_html); alert('this is just alert for take time of panel' rendering. When you press ok button, all contents of panel will render right'); alert(Ext.get('id9').dom.offsetTop); // this offset is right !!! It is 3200
Code:(function(){ alert(Ext.get('id9').dom.offsetTop); // this offset is right !!! It is 3200 }).defer(500);
-
29 Jul 2010 6:59 AM #9
-
29 Jul 2010 7:28 AM #10
If it's a large block, and it updates asynchronously (which it seems to be) Then try using the callback option to update.
http://www.sencha.com/deploy/dev/doc...&member=updateSearch the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Similar Threads
-
Panel and afterrender problem
By ChiefDanGeorge in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 15 Apr 2010, 9:44 AM -
afterRender not firing
By yyogev in forum Ext 3.x: Help & DiscussionReplies: 5Last Post: 19 Oct 2009, 4:10 AM -
[SOLVED] Panel plugin problem - how to add 'afterrender' event
By nugatto in forum Ext 2.x: Help & DiscussionReplies: 11Last Post: 30 Jun 2008, 11:24 PM


Reply With Quote