行一恒  

2013年9月3日

摘要: 今天早上,想在自定义组件中展示数据的个数,用了n久,data.Store 的getCount方法,总是返回为0,但是用console.log()该store,却有数据,如此让人抓狂!后来终于明白了,因为在在自定义组件构造函数中,此时store并没有加载完,故无法此时操作store,而console.log()方法执行于渲染之后,原来是执行周期搞了鬼!才导致被欺骗,真是浪费时间。不过我们可以这样操作store: me.store.load({ callback:function(records,opeartion,success){ if(success){ me.buttombar.getC. 阅读全文
posted @ 2013-09-03 13:45 行一恒 阅读(244) 评论(0) 推荐(0)