Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext User
    Join Date
    Aug 2007
    Posts
    16
    Vote Rating
    0
    jonnycattt is on a distinguished road

      0  

    Default using XTemplate in AIR

    using XTemplate in AIR


    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

  2. #2
    Ext User
    Join Date
    Aug 2007
    Posts
    16
    Vote Rating
    0
    jonnycattt is on a distinguished road

      0  

    Default


    solved the security part. just needed to read the air docs about the sandboxes.

    i'm still wondering though if what I'm doing in that code is the standard for making ajax calls and looping over results.

    thanks.