dmillasich
2 Feb 2011, 3:38 PM
Hi - I've got a script that's making a server request for a json response. The request is returned by the server and I can see it in the Javascript callback function - however, the data never makes it into the data store.
There are no errors reported after the server has satisfied the request. Is there something required by the javascript callback function beyond what I've been able to glean from the documentation?
Thanks for any help.
Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function(){
/* set up model */
Ext.regModel('Movie', {
fields: [{name:'title'}, {name:'year'}]
});
/* define store */
var myStore = new Ext.data.Store({
model: 'Movie',
proxy: {
type: 'scripttag',
url: 'http://my.server.com/channel/getmovielist/callback/getResponse',
reader: {
type: 'json',
root: 'movies'
},
},
autoLoad: true
});
/* call me when you get back in town */
getResponse = function(response) {
Ext.Msg.alert('What', 'Now?');
};
var toolbar = new Ext.Toolbar({
dock: 'top',
title: 'Toolbar',
items: [{
text: 'button',
handler: function() {
Ext.Msg.alert('clickity', 'click');
}
}]
});
new Ext.Panel({
fullscreen: true,
dockedItems: [toolbar]
});
}
});
There are no errors reported after the server has satisfied the request. Is there something required by the javascript callback function beyond what I've been able to glean from the documentation?
Thanks for any help.
Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function(){
/* set up model */
Ext.regModel('Movie', {
fields: [{name:'title'}, {name:'year'}]
});
/* define store */
var myStore = new Ext.data.Store({
model: 'Movie',
proxy: {
type: 'scripttag',
url: 'http://my.server.com/channel/getmovielist/callback/getResponse',
reader: {
type: 'json',
root: 'movies'
},
},
autoLoad: true
});
/* call me when you get back in town */
getResponse = function(response) {
Ext.Msg.alert('What', 'Now?');
};
var toolbar = new Ext.Toolbar({
dock: 'top',
title: 'Toolbar',
items: [{
text: 'button',
handler: function() {
Ext.Msg.alert('clickity', 'click');
}
}]
});
new Ext.Panel({
fullscreen: true,
dockedItems: [toolbar]
});
}
});