PDA

View Full Version : How to get a value from a Ext.data.JsonStore



jlopescruz
21 Feb 2010, 4:43 PM
I'm getting the following Json file output:
{success:true,results:1,rows:[{"idMissao":"1","missao":"Some Text..." (...)

How can i get the value from "missao" to a textarea?

I'm trying with, but it shows nothing...
{xtype:'textarea',readOnly:true,name: 'missao',value:store_missao.getById('missao')}]});

Thanks in advance.

goldledoigt
22 Feb 2010, 12:57 AM
var value = store_missao.getAt(rowIndex).get("missao");

?

tobiu
22 Feb 2010, 5:31 AM
since you are using a json-store i would bet that your store is not loaded, when you are creating the textarea.

if you generally want to load a form, use BasicForm.load().
if you want to use the store you have, set a listener on store.load.


kind regards,
tobiu

jlopescruz
22 Feb 2010, 2:02 PM
thanks, i already solved my problem.
Here is a tutorial that may help others:
http://www.extjs.com/learn/Tutorial:Loading_Data_Into_and_Submitting_a_Form

b regards,
Joćo Cruz