PDA

View Full Version : Loading an external website in a panel



DJ JJ
20 Mar 2011, 11:00 AM
I'm trying to load ad external website in my panel (e.g. www.google.com). With a page that is on the same host, it works fine.



var tp = Ext.getCmp('pannellocentrale');
var tab = tp.add({
title: 'Report',
closable: true,
id: 'report',
autoLoad: {
url: 'http://www.google.com',
scripts: true
}
});


With the url as in the code, I get this error:
XMLHttpRequest cannot load http://www.google.com/. Origin http://localhost is not allowed by Access-Control-Allow-Origin.

If I try with url: 'www.google.com' I get:
GET http://localhost/datarise/www.google.com 404 (Not Found)

As last solution, I also tried to call an HTML page with redirect:


<html>
<head>
<title>foo</title><meta http-equiv="Refresh" content="0; url=http://www.google.com">
</head>
<body></body>
</html>


but nothing, I have always the spinnig wheel with Loading...

walldorff
21 Mar 2011, 6:55 AM
I suggest you read about originating domain and Ext.data.ScriptTagProxy (http://ww.extjs.com/learn/Manual:Data:Proxies:ScriptTagProxy)

Ext.data.ScriptTagProxy - An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain other than the originating domain of the running page.
Example is here (http://dev.sencha.com/deploy/dev/examples/grid/paging.html).

DJ JJ
21 Mar 2011, 7:00 AM
so, the autoload is not good?

DJ JJ
22 Mar 2011, 1:07 AM
so, I have to use a store. And I can't attach a store to a panel. Should I use a gridpanel??

walldorff
22 Mar 2011, 7:20 AM
Well, the Paging Grid Example does contain a grid, isn't it?
So go from there. There's so much to learn, look for examples from Saki, Jay Garcia and many others. Also Condor has a huge amount of posts you can learn from.