-
23 Apr 2010 9:39 AM #1
store data from Store(Ext.data.JsonStore) in variable
store data from Store(Ext.data.JsonStore) in variable
Hi all. I'm new arround here...
I need to retrieve data fom my Store and put one field into a variable...something like this:
and then get the value of the field 'v_placa' and put it into a variable:Code:initStores: function(){ this.dslista_1 = new Ext.data.JsonStore({ url: 'listar_L1.php', root: 'data', idProperty: 'num_controle', fields: [ 'id', 'num_controle', 'v_placa', 'v_marca' ] }) }
variable = store/store_field
var placa = dslista_1.v_placa; <--- The question is...how can I do that?
Thx
-
23 Apr 2010 1:34 PM #2
You will need to access a specific record inside the store, at which point you can hit the data stored in the record directly. For example, if you knew you had 1 record in the store dslista_1:
Code:var record = dslista_1.getAt(0); var placa = record.data.v_placa;
-
26 Apr 2010 3:58 AM #3
-
26 Apr 2010 6:58 AM #4
Glad I could help =D


Reply With Quote