While using this code, i can’t get any results…
Ext.define('Teste.view.Main', {
extend: 'Ext.Container',
initialize: function(){
Ext.define('User', {
extend: 'Ext.data.Model',
config: {
fields: ['description', 'discountCode' , 'prodCode'],
proxy: {
type: 'rest',
format:'json',
url : 'http://localhost:8080/stcws/resources/com.database.productcode/'
}
}
});
var store = new Ext.create('Ext.data.Store', {
model: 'User'
});
store.load();
console.log(store.getCount());
}});
But if i take out
format:'json',
I get a XML response, what i’m doing wrong?
To use the ‘Rest’ proxy and get a Json response we just need to add to the Proxy:
And take out…