PDA

View Full Version : I canīt read JsonStore, help it



Victoro
15 Aug 2013, 1:27 PM
I can load a combo or gridpanel with store, but I cant read to record from store, it is code:

var storePro = new Ext.data.JsonStore({
id:'stProd',
url: 'productos!jsonProducto.romy',
fields: ['cveArt','describe','cveLinea','cveTipoProd','calibre'],
listeners:{
exception: function(proxy, type, action, o, response, args) {
Ext.MessageBox.alert("Error", 'Error al cargar datos de Productos ');
},
},
autoLoad:true,
});

st = Ext.StoreMgr.lookup('stProd');
ind = st.find('nameField','valueSearch');
rec = st.getAt(ind);
va =rec.get('nameField');
Ext.MessageBox.alert(va);



ind always is -1, help please!!

sthanar
16 Aug 2013, 1:08 AM
Are you sure, path given in the url parameter right?, if so try the below
proxy: new Ext.data.ScriptTagProxy({
url: <url>
})

or
proxy: new Ext.data.HttpProxy({
url: <url>
})

Victoro
16 Aug 2013, 6:11 AM
Thanks Sthanar

I can load store and load grid with it, but I dont need the grid, I need to read the record from store directly, Iīll use a jsonreader and say you.