-
6 Feb 2007 10:51 AM #1
Re-render BasicDialog with different content
Re-render BasicDialog with different content
I may be missing something but it seems like the BasicDialog's constructor-style initialization is not very conducive to re-rendering with a different DOM source.
I'd like to pop up a BasicDialog with a loading indicator in the body area until an AJAX request returns a snipet of HTML to be used as the new contents of the BasicDialog (via DomTemplate). It looks like I'm going to have to recreate a portion of the BasicDialog constructor code to accomplish this.
Is there a better way?
-
6 Feb 2007 11:03 AM #2
Couldn't you just reset the value of the innerHTML of the dialog box to the HTML you received after loading has complete. For example
Code:getEl('dialog-center').dom.innerHTML = "text presented to user"
-
6 Feb 2007 11:17 AM #3
That doesn't help with the header or footer. Also, I may want it to auto-tab the new content, etc.
I may put in a request that the various bits of logic are encapsulated within methods so they can be called individually. For example if there was:
We could easily re-render the existing BasicDialog with a different element without doing too much magic. It'd be nice to also be able to pass in a DomTemplate instead of an element.Code:render : function(el) { // Render the passed in el }
-
6 Feb 2007 11:50 AM #4
what I've been using for a while for the creation of dynamic BasicDialog is the autoCreate config parameter like so:
using the reference to the BasicDialog you can get to the dynamically created body, header or footer like this:Code:basicDialog = new YAHOO.ext.BasicDialog("", { autoCreate:true, modal:true, width:600, height:300, shadow:true, resizable: false, proxyDrag: false, shim:true, title:'myTitle' });
to overwrite the body of the dynamic BasicDialog with a template just do so:Code:getEl(basicDialog.body.id); getEl(basicDialog.header.id); getEl(basicDialog.footer.id);
Code:yourTemplate.overwrite(basicDialog.body.id);
-
6 Feb 2007 12:03 PM #5
Thank you for the response but it's still doesn't quite hit the mark that I'm trying to hit.
I understand that I can hook in and directly manipulate the DOM but wouldn't it be nice if we could simply redraw the BasicDialog using the same exact logic that Jack does without having to copy/paste the logic ourselves or destroy/recreate the BasicDialog?
-
6 Feb 2007 12:06 PM #6
I'd like to be able to do something like this:
thenCode:var dlg = new BasicDialog('myEl', myCfg); dlg.show();
orCode:dlg.redraw('myNewEl');
Code:var tpl = new YAHOO.ext.Template('...some html...'); dlg.redraw(tpl);
-
6 Feb 2007 12:37 PM #7
You'll have to get your hands dirty with code and extend the BasicDialog class then :wink:
Originally Posted by kalebwalton
Similar Threads
-
Re-render content in resizable column using custom renderer?
By KimH in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 25 Jun 2008, 8:34 AM -
[OPEN] Bug in Dialog Render
By Bobafart in forum Ext 1.x: BugsReplies: 12Last Post: 14 Feb 2007, 7:40 PM -
BasicDialog autoTabs with dynamic content
By sjivan in forum Ext 1.x: Help & DiscussionReplies: 8Last Post: 20 Dec 2006, 10:31 AM -
Checkbox render
By alex1er in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 9 Nov 2006, 6:56 AM -
BasicDialog incompatible with ylayout-inactive-content?
By SteveEisner in forum Ext 1.x: BugsReplies: 5Last Post: 6 Nov 2006, 3:10 PM


Reply With Quote