-
1 Aug 2008 12:20 AM #1
autoLoad panel
autoLoad panel
Hi. I'd like to load a simple html page inside a Panel so I tried to use the property autoLoad but it doesn't work, I have no one error but nothing happen
!
This is my js file:
My html file is very simple because for the moment I only want to understand how can I load a html file inside a panel:Code:Ext.onReady(function(){ var button = Ext.get('show-btn'); button.on('click', function(){ var menu=new Ext.Panel({ id:'menu', region:'center', autoLoad: { url: 'info.html', scripts: false, text:'Loading...' } }); var win = new Ext.Window({ id:'finestra-menu', title: 'Menu principale', region:'center', closable:true, collapsible:true, width:180, height:350, x:1095, y:33, draggable:false, plain:true, layout: 'border', items:[menu] }); win.show(this); }); });
HTML Code:<html> <head> <title>Vercelli Book</title> <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" /> <link rel="stylesheet" type="text/css" href="stile/layout.css" /> <link rel="stylesheet" type="text/css" href="stile/zoom.css" /> [code] <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script> <script type="text/javascript" src="../../ext-all.js"></script> <script type="text/javascript" src="js/layout.js"></script> <script type="text/javascript" src="js/navigazione.js"></script> <script type="text/javascript" src="js/funzioni.js"></script> [/code] </head> <body> <p>ciao siamo le info</p> </body> </html>
Please..... HELP ME!!!
Bye, Francesca
-
1 Aug 2008 12:47 AM #2
try get rid of the css and script references in info.html, this should work fine...
-
1 Aug 2008 12:53 AM #3
Sorry, but I'm just at the beggining with this kind of project so can you write me an example please?
Thanks!
-
1 Aug 2008 1:34 AM #4
replace the content of your info.html by
if this is not working try to see in firebug if you are getting the content for that filePHP Code:<html>
<head>
<title>Vercelli Book</title>
</head>
<body>
<p>ciao siamo le info</p>
</body>
</html>
-
1 Aug 2008 1:41 AM #5
What is loaded is an HTML fragment, not a page. The <html>, <head>, <body> etc tags will be ignored because what happens is that it just gets put into innerHTML.
So just send
If you really want to include scripts, then include those scripts in the <head> of the main page. Do not include them later (And possibly multiple times) through Ajax, load them once at page load.Code:<p>ciao siamo le info</p>
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
-
1 Aug 2008 1:53 AM #6
I try to explain better my situation because even if I replaced my html code autoLoad is not doing well. So, I have a main page with some buttons. When I click on one of these, I open a window where I want to load the html page that you saw.
I have:
a main page that contains the button
the window opened by this button (file js contains the function to do this)
the html file that must be viewed inside the window
When I load tha main page and I click on my button I don't have any error by firebug... why?
-
1 Aug 2008 1:58 AM #7
Why not just autoLoad the Window rather than adding a Panel to the Window and autoLoading the Panel?
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
-
1 Aug 2008 2:05 AM #8
Ok, I did everything you told me but it doesn't well... so this is my html page
and this is my js pageHTML Code:<p>ciao siamo le info</p>
Where is the problem?Code:Ext.onReady(function(){ var button = Ext.get('show-btn'); button.on('click', function(){ var win = new Ext.Window({ id:'finestra-menu', title: 'Menu principale', region:'center', closable:true, collapsible:true, width:180, height:350, x:1095, y:33, draggable:false, plain:true, autoLoad: { url: 'info.html', scripts: false, text:'Loading...' } }); win.show(this); }); });
-
1 Aug 2008 2:17 AM #9
What's the problem? Have you checked the window's DOM using Firebug? Have you checked the XHR content and status using Firebug? Basically, have you been a professional developer and degbugged?
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
-
1 Aug 2008 2:38 AM #10
I'm sorry that you can't help me... I used firebug but I don't have any kind of experience so it's very hard for me to understand where's the problem... I'm not a professional developer and maybe THIS is the problem!
However thanks for your help


Reply With Quote