在Extjs中,我试图从变量Store
中选择一个值accrued
。从变量中选择一个值
我想:
var newStore = Store.data.items[0].data.accrued;
上面一个是行不通的。我得到错误:
Uncaught TypeError: Cannot read property 'data' of undefined
每当我添加items[0]
,它使变量未定义。
当我检查:
var newStore = Store.data.items.length;
输出为: //?
但是我可以看到在Store
变量中有项目,如上图所示。无论如何,我只想从变量Store
中获得accrued
的值。
我还检查:
var newStore = Store.data.items;
输出是:[]
存储或存储?第一个带有“S”的上行。 – coderLMN 2013-03-13 05:49:28
对不起,这是错字。 'Store' @ JinZhaoWu – 2013-03-13 05:50:19
尝试'for(x in Store.data.items)console.log(x);'确保索引确实是'0'? – techfoobar 2013-03-13 05:54:26