PDA

View Full Version : return to store



pdpdao
11 Jul 2014, 9:13 AM
Hello guys,

if anyone can help me, I wonder how do I get the return store. I'm trying to recover from the following I form:
var op = _store_orbitaponto.data.items [0]. data.orbita_ponto.

The following error is shown in console.
Uncaught TypeError: Can not read property 'data' of undefined app.js: 282

but when I type the same command in the console output appears correctly.
Take a look:
_store_orbitaponto.data.items [0]. data
Object {orbita_ponto: "220-75"}
_store_orbitaponto.data.items [0]. data.orbita_ponto
"220-75"

Since now, thank you.
Pedro

mitchellsimoens
16 Jul 2014, 11:06 AM
I'm assuming _store_orbitaponto is a global variable (be careful of using global variables). Is the store created when you are trying to access it? Also, doing store.data.items[0] is really messy, use store.getAt(0)