View Full Version : How to update a part of a content panel?
Magicbob
28 Jun 2007, 9:35 AM
Hello
I'd like to update a part of a contentpanel (replace the content of a div in this panel by something else after a click on an icon).
How can i do that?
Magicbob
kilrae
28 Jun 2007, 10:23 AM
Every element has an UpdateManager, so I believe something like this should work:
um = Ext.get('panel-section').getUpdateManager();
um.update('new-content.htm');
Magicbob
28 Jun 2007, 11:28 AM
Thanks for the answer but it is not exactly what i want
Here is the code of what i was doing before to put my content in a contentpanel :
Ext.get("div_accueil").update('<a href="javascript:toutmontpellierAccueil.deconnexion();"> <div id="seDeconnecter" class="Accueil"> ' + _("accueil_deconnection") + ' </div> </a>');
but it is not working anymore
the method you gave me need an url and i just want to update the div with new text and not a new page.
Magicbob
tryanDLS
28 Jun 2007, 11:35 AM
What's not working? It's just putting a string into the innerHTML - do you see it when you view the html in firebug? Are you sure you don't have mismatched quotes?
Magicbob
28 Jun 2007, 12:22 PM
I have try with this :
Ext.get("div_accueil").update('test');
but the result is the same. No update visible on the screen but in firebug, innerhtml and textcontent are updated
Magicbob
tryanDLS
28 Jun 2007, 2:39 PM
If the innerHTML is there, are you sure it's not in a container that's hidden or positioned out of the viewable area?
Magicbob
28 Jun 2007, 2:45 PM
thanks for your answer
In fact i was doing a mistake in my way to create and fill the panel
because of that , i had a duplicate <div id="div_accueil"> and it was updating the one not in the panel.
Magicbob
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.