I don't quite understand what the autoCreate config does in the BasicDialog constructor.
I've got an existing div with some content that I want to be displayed in a BasicDialog box.
Is there an option to just put the appropriate wrappers around my div and it be displayed in the dialog? Is that the autoCreate (wrappers)?
Is this even possible or do I have to go add all the appropriate classes to the div's I wanted displayed?
I've got an existing div with some content that I want to be displayed in a BasicDialog box.
Is there an option to just put the appropriate wrappers around my div and it be displayed in the dialog? Is that the autoCreate (wrappers)?
Is this even possible or do I have to go add all the appropriate classes to the div's I wanted displayed?
![Reply With Quote](http://extjs.com/forum/images/buttons/quote.gif)
#
2
![]() |
![]()
If you have existing content, don't use autoCreate.
Try [code] ... var myDlg = new Ext.BasicDialog("my-dialog", {...}); </script> </head> <body> <div id="my-dialog"> <div id="my-dialog-body"> Content... </div> </div> [/cide] ![]() |
#
3
![]() |
![]()
so what is autoCreate used for then?
how do you add body content to a dialog that has been autoCreate'd? ![]() |
#
4
![]() |
![]()
With autoCreate, Ext will generate the needed markup for you. You can always get a reference to the body's dom node and write whatever you want into its innerHTML, the same as if you had static content already there at design time.
__________________
Brian Moeskau FAQ / Tutorials / User Extensions / Enhanced Forum Search ![]() |
#
5
![]() |
![]()
Its getting a reference to the body's dom node part that I dont understand...
If I use "autoCreate: true" in the dialog config, then it creates a dialog body with a random id (ie: ext-gen8), so how do I get that dom node id? ![]() |
#
6
![]() |
![]()
Sometimes reading the docs helps, even in alpha stage
![]() See the first item in the public properties list of the BasicDialog docs. ![]() |
#
7
![]() | |
![]()
Quote:
yourDialog.body.id
__________________
Ext readings for beginners | Ext manual's resources section | Ext documentation center | Ext Tutorials | Ext screencasts | Ext FAQs | Ext Forum Index | Various Debugging Tools for IE & Firefox My Ext's Wiki user page ![]() |
#
8
![]() |
![]()
haha....its the very first one....sometimes i just wish i could kick myself
I sware I really did read the docs, I dont know how I managed to miss that. ![]() |
#
9
![]() |
![]()
So it seems like the answer to INeedADip's questions would be to do something like this...
dialog = new Ext.BasicDialog("my-dialog", { ... autoCreate: true, ... }); document.getElementById(dialog.body.id).innerHTML = document.getElementById('my-div').innerHTML; <body> <div id="my-div">Content...</div> </body> ![]() |
#
10
![]() |
![]()
Carefull just copying the innerHTML from one DIV to another...especially if there are named fields or objects.
![]() |