2014年3月26日
摘要: Store.getCount()返回的是store中的所有数据记录,然后使用for循环遍历整个store,从而得到每条记录。除了使用getCount()的方法外,还可以使用each()函数,如下面的代码所示。1.store.each(function(record){ 2.alert(record.get('name')); 3.});Each()可以接受一个函数作为参数,遍历内部record,并将每个record作为参数传递给function()处理。如果希望停止遍历,可以让function()返回false。也可以使用getRange()函数连续获得多个record,只需要 阅读全文
posted @ 2014-03-26 12:51 李九妹 阅读(206) 评论(0) 推荐(0) 编辑