-
24 Oct 2012 11:28 PM #1
TreePanel with cross domain data
TreePanel with cross domain data
Is it possible to load data for a treepanel from a cross domain source?
I tried to use a ScriptTagProxy inside my TreeLoader but I can't get it working. Any suggestions?
Thanks for you help
-
25 Oct 2012 11:36 PM #2
JsonStore inside directFn
JsonStore inside directFn
I managed to do it with a JsonStore and ScriptTagProxy inside the directFn function. However I don't know if this is a good solution or if the is a better or even simpler way to do it.
Code:new Ext.tree.TreeLoader({ directFn:function(nodeId, callback ){ var store = new Ext.data.JsonStore({ root: 'folders', totalProperty:"results", idProperty: 'id', remoteSort: true, autoLoad: false, fields: [ 'id', 'name', 'text', 'type' ], proxy: new Ext.data.ScriptTagProxy({ url: 'http://someurl.ch/data/test.php' }) }); store.load({ callback: function(){ var response = []; for(i=0;i<store.data.items.length;i++){ response.push(store.data.items[i].data); } console.log(response); callback(response, {status:true}); }, params: {folder:nodeId} }); } })
-
4 Jan 2013 1:41 PM #3
Thats the only way to do it , afaik.
Extensions:
Ext.ux.DatePickerPlus (Multimonth,Multiselect,...)
Ext.ux.menu.StoreMenu - Ajax Store as menu-item config
Extended Window - Aero Shadows, nested grayscaled modal windows
Ext.MessageBox.promptCombo/promptRadio/promptCheckbox
Ext.ux.plugin.triggerfieldTooltip (for Comboboxes, Datefields...)
Ext.util.MD5
Ext.util.Utf8 (encode/decode)
Ext.util.base64 (encode/decode)
Using:
ExtJS 3.4.1.1/4.2
XPsp3/W7sp1
IE8/9/10
FF 20
Chrome 26


Reply With Quote