Hi guys, I have a problem when I try to set data into my store, I saw in this post one way to do that but is using ST 2.0, how can I do the same but in 1.1? I refer to:
http://www.sencha.com/forum/showthread.php?196949-SOLVED-Load-store-from-a-variable.
This is my code:
Code:
ui: 'confirm', text: 'Buscar',
iconMask: true,
iconCls: 'search',
handler: function() {
formBuscaMat.submit({
params: {
codigo: formBuscaMat.getValues().codigo,
codigoAntiguo: formBuscaMat.getValues().codigoAntiguo,
descripcion: formBuscaMat.getValues().descripcion
},
method: 'POST',
waitMsg: { message: 'Connecting...', cls: 'demos-loading' },
success: function(form, action) {
if (action.success) {
var lista = new listaMatModel(action.materiales);
var store = listaMat.getStore();
console.log(store);
store.setData(lista);
store.sync();
buscaMatView.setActiveItem('listaMatPanel', { type: 'slide', direction: 'left' });
}
}
});
}
Store:
Code:
var listaMatStore = new Ext.data.Store({
proxy: new Ext.data.LocalStorageProxy(
{
id: 'materialData',
proxy:
{
idProperty: 'listaMatStore'
}
}),
model: 'listaMatModel',
autoLoad: true,
autoSave: true
});
Please help me, any idea.
Thanks in advance.