Greetings all,
I'm just starting to experiment with ext and air together. This is my first attempt. In a nutshell, I'm trying to make an ajax call and then loop over the results and display them in a panel. This works fine in the browser, but in air I get a "Adobe AIR runtime security violation for javascript code in the application security sandbox (eval)"
Here's my code, in its entirety:
Code:
Ext.onReady(function(){
var ds = new Ext.data.Store({
//set up the URL. the grid fetches data from here --->
proxy: new Ext.data.HttpProxy({
url: 'http://localhost:8501/argus/dope/ajax/cfc/cfcproxy.cfm?functionToRun=getMasterServers'
}),
reader: new Ext.data.JsonReader({
root: 'data',
totalProperty: 'totalavailable',
id: 'masterid'
} ,
[
{name:'masterid'},
{name:'masterip'}
]
) ,
remoteSort: false
});
ds.load();
var tpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="" id="{masterid}">',
'<span class="">{masterip}</span></div>',
'</tpl>',
'<div class="x-clear"></div>'
);
var panel = new Ext.Panel({
id:'servers',
frame:true,
width:300,
autoHeight:true,
collapsible:true,
layout:'fit',
title:'servers',
items: new Ext.DataView({
store: ds,
tpl: tpl,
autoHeight:true,
multiSelect: true,
itemSelector:'',
emptyText: 'No servers to display'
})
});
panel.render(document.body);
});
So, two questions:
1) actually, my more important question: is this the right way to go about trying to render such simple content? It seems like an awful lot of code! I've only ever used the EXT widgets (grids, trees, and the like) and haven't really done something as simple as just load json via ajax and display it.
2) How can I fix this security exception? It looks to me like the problem is with XTemplate, since I can run the ajax call just fine.
Thanks for input, folks.
marc