Extjs 5 ext.app.viewmodel, Tiendas - Cargar datos usando Proxy
Pregunta
Estoy intentando cargar datos de servidor y enlaces.Tal método no funciona.¿Qué ocurre?
Ext.define('Configurator.view.activityType.ActivityTypeModel', {
extend: 'Ext.app.ViewModel',
alias: 'viewmodel.activityTypeModel',
stores: {
ticketStatusSummary: {
fields: ['id', 'title', 'name'],
autoLoad: true,
proxy: {
url: '{prefix}/{entityName:uncapitalize}',
pageParam: '{pagaParam}',
startParam: '{startParam}',
limitParam: '{limitParam}'
} }
}
...
Solución
El problema es la resolución. El problema es con el proxy - desconocido lector
reader: {
type: 'json',
}
Código real:
Ext.define('Configurator.view.activityType.ActivityTypeModel', {
extend: 'Ext.app.ViewModel',
alias: 'viewmodel.activityTypeModel',
stores: {
ticketStatusSummary: {
fields: ['id', 'title', 'name'],
autoLoad: true,
proxy: {
url: '{prefix}/{entityName:uncapitalize}',
pageParam: '{pagaParam}',
startParam: '{startParam}',
limitParam: '{limitParam}',
reader: {
type: 'json',
}
}
}
}
...
Otros consejos
Estoy sorprendido de que tenga que definir todo esto dentro de su ViewController ...
Debe poder hacer: (Todavía estoy tratando de descubrir esto, no creo que sea el código correcto).
stores:{
ticketSummary:'MyApp.stores.TicketSummary'
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow