PDA

View Full Version : JsonStore



shah10
26 Jul 2010, 2:04 PM
Hi,
I am trying to access a public store with the following code. It works for Sencha but not Sencha-Touch.
Any help would be greatly appreciated.
regards,
Shah




Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {
var fields = [
{
name: 'lastName',
mapping : 'lastname'
}

];

Ext.regModel('Contact1', {
fields: fields
});


var proxy = new Ext.data.ScriptTagProxy(
{
//url: 'http://localhost:8084/WebApplication1/HelloWorld'
url: 'http://extjsinaction.com/dataQuery.php'
});

var myStore = new Ext.data.JsonStore({

proxy: proxy,
root: 'records',
model : 'Contact1',

autoload : true,
listeners :
{
load: function(obj, records)
{
Ext.each(records, function(rec){console.info('hi' + rec.get('lastName'))});

}
}
});

myStore.load();


}
});