PDA

View Full Version : Loading script content in panel



Emmy
8 Jun 2012, 2:50 PM
Hi all,

We have a tree panel that when you click on a node, it loads up data in another panel from a URL. When the URL returns plain text data, it works fine. However, if we try to load up any dynamic content (e.g. an extjs button) nothing happens (the div is just empty). We have the "scripts: true" parameter set. Here's the tree panel code:


{
id: 'tree-id',
xtype: 'treepanel',
store: store,
listeners: {
itemclick : function(view,rec,item,index,eventObj) {
var itemid = rec.get('id');
Ext.get("content-panel").load({
url:"/my/url?id=" + itemid,
text:"loading",
scripts:true
});
}
},
}

Any ideas? I saw somewhere that perhaps it's because extjs 4.0 doesn't support .load any more? Although it does work fine for plain text data.

Thanks in advance for your help!

S.

Emmy
9 Jun 2012, 9:58 PM
Hi all,

Anyone got any ideas..?

Thanks!

S.

evant
9 Jun 2012, 10:04 PM
What's included in the loaded content? Also, moving to the Ext4 subforum.

Emmy
12 Jun 2012, 11:47 AM
Hi,

If the loaded content is just text, it works fine. For example:


<? echo "This is a test"; ?>

However, if the loaded content is a script, it doesn't work at all (empty div). For example:


<? echo "<script type='javascript'> ... some extjs javascript ... </script>"; ?>

Thanks!

S.

Jad
12 Jun 2012, 11:10 PM
Hello Emmy,
I think you should use function eval()