irfaniqbal
28 Dec 2010, 6:35 AM
Hi,
I am using ScriptTagProxy to get json data from another domain. But no request sent. I have used it many ways. Also follow many forum posts but the problem is still there :s. Here is my code.
Ext.setup({
glossOnIcon: false,
onReady: function(){
Ext.regModel('Supplement', {
fields: [
{name: 'name', type: 'string'},
{name: 'supplement_timings', type: 'string'},
{name: 'unit', type: 'string'},
{name: 'instructions', type: 'string'}
]
});
var store = new Ext.data.JsonStore({
model: 'Supplement',
proxy: new Ext.data.ScriptTagProxy({
url: "<?=$this->base?>/supplements/getSupplements/<?=$uuid?>"
}),
reader: new Ext.data.JsonReader({
root: 'supplements'
}, [
{name: 'name', mapping: 'name'},
{name: 'supplement_timings', mapping: 'supplement_times'},
{name: 'unit', mapping: 'unit'},
{name: 'instructions', mapping: 'instructions'}
])
});
var list = new Ext.List({
fullscreen: true,
indexBar: true,
store: store,
itemTpl : '<tpl for="."><div><b>{name}</b></div></tpl>'
});
var cont = new Ext.Panel({
fullscreen: true,
layout: 'card',
items:
[list],
dockedItems: dockedItems
});
}
});
The url i used in ScriptTagProxy is a PHP function which gets the Json data from other domain.
I have also validate my Json and there is no problem with it. Can anyone please help me to solve this problem? thanks in advance.
I am using ScriptTagProxy to get json data from another domain. But no request sent. I have used it many ways. Also follow many forum posts but the problem is still there :s. Here is my code.
Ext.setup({
glossOnIcon: false,
onReady: function(){
Ext.regModel('Supplement', {
fields: [
{name: 'name', type: 'string'},
{name: 'supplement_timings', type: 'string'},
{name: 'unit', type: 'string'},
{name: 'instructions', type: 'string'}
]
});
var store = new Ext.data.JsonStore({
model: 'Supplement',
proxy: new Ext.data.ScriptTagProxy({
url: "<?=$this->base?>/supplements/getSupplements/<?=$uuid?>"
}),
reader: new Ext.data.JsonReader({
root: 'supplements'
}, [
{name: 'name', mapping: 'name'},
{name: 'supplement_timings', mapping: 'supplement_times'},
{name: 'unit', mapping: 'unit'},
{name: 'instructions', mapping: 'instructions'}
])
});
var list = new Ext.List({
fullscreen: true,
indexBar: true,
store: store,
itemTpl : '<tpl for="."><div><b>{name}</b></div></tpl>'
});
var cont = new Ext.Panel({
fullscreen: true,
layout: 'card',
items:
[list],
dockedItems: dockedItems
});
}
});
The url i used in ScriptTagProxy is a PHP function which gets the Json data from other domain.
I have also validate my Json and there is no problem with it. Can anyone please help me to solve this problem? thanks in advance.