-
14 Oct 2007 4:45 PM #1
onload possible?
onload possible?
I found the script in one of the demos here: http://extjs.com/deploy/ext/examples...g/msg-box.html
Is there a way to make it so that when the page loads the message pops up? I got it so that works on my own server and I thought I could use onload in the body tag, but im not sure what to put in it.
Thanks for the help!
-
14 Oct 2007 4:56 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,167
- Vote Rating
- 29
it's better off to use Ext.onReady(fn(){}); than on the onload event.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
14 Oct 2007 6:40 PM #3
How would I do that? I just found Ext and don't know much yet.
-
14 Oct 2007 10:46 PM #4
http://extjs.com/deploy/dev/docs/?cl...member=onReady
If that doesn't help, then it's not Ext you're having a problem with.
-
15 Oct 2007 12:04 PM #5
Is there a way to do that in v1.1? I was looing through the documentation thing and didn't see anything called that for v1.1.
-
15 Oct 2007 12:30 PM #6
You should use Ext.onReady to initialize all your variables/widgets so this would be a good place to make a dialog pop up.
In your page just enter some script like this
a Popup should appear when the page loads because Ext will be ready shortly after the page loads.Code:<script> Ext.onReady(Ext.Msg.show({title:'Hello',msg:'This is a message', buttons:Ext.Msg.YESNO, fn:javascriptFunctionToCallWithResponse})); function javascriptFunctionToCallWithResponse(btn) { if (btn == 'yes') { alert('you pressed YES! Why do I care? hmmm......'); } } </script>
-
15 Oct 2007 1:59 PM #7Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,167
- Vote Rating
- 29

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
15 Oct 2007 2:08 PM #8
-
18 Jan 2008 10:15 AM #9
I know this can be an annoying question to a trained person but can you please give me an example of an onload message box prompt with two text boxes to fill.
Regards,
P.S : This is what i want to show when the page loads :
The thing is I want two text boxes in the dialog.Code:Ext.onReady(function(){ Ext.MessageBox.prompt('Name', 'Please enter your name:'); });


Reply With Quote