willyaguirre
31 Jul 2012, 5:52 AM
I'm using sencha extjs 4.1
Ext.define('VE.model.Usuario', {
extend: 'Ext.data.Model',
fields: ['name', 'id']
});
Ext.define('VE.store.Stusuario', {
extend: 'Ext.data.Store',
model: 'VE.model.Usuario',
autoLoad: true,
proxy: {
type: 'jsonp',
url: 'http://vivid-sunset-6133.herokuapp.com/bars.json',
reader: {
type: 'json'
}
}
});
Ext.define('VE.view.data.Usuario', {
extend: 'Ext.grid.Panel',
alias: 'widget.listusuarios',
title: 'Lista de Usuarios',
renderTo: Ext.getBody(),
store: 'Stusuario',
initComponent: function() {
this.columns = [
{
header: 'Name',
dataIndex: 'name',
flex: 1
},
{
header: 'Id',
dataIndex: 'id',
flex: 1
}
];
this.callParent(arguments);
}
});
The problem is: json doesn't upload data on grid panel
Ext.define('VE.model.Usuario', {
extend: 'Ext.data.Model',
fields: ['name', 'id']
});
Ext.define('VE.store.Stusuario', {
extend: 'Ext.data.Store',
model: 'VE.model.Usuario',
autoLoad: true,
proxy: {
type: 'jsonp',
url: 'http://vivid-sunset-6133.herokuapp.com/bars.json',
reader: {
type: 'json'
}
}
});
Ext.define('VE.view.data.Usuario', {
extend: 'Ext.grid.Panel',
alias: 'widget.listusuarios',
title: 'Lista de Usuarios',
renderTo: Ext.getBody(),
store: 'Stusuario',
initComponent: function() {
this.columns = [
{
header: 'Name',
dataIndex: 'name',
flex: 1
},
{
header: 'Id',
dataIndex: 'id',
flex: 1
}
];
this.callParent(arguments);
}
});
The problem is: json doesn't upload data on grid panel