Ext.onReady(function(){
//案例一
/*
var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];
Ext.Array.each(countries, function(name, index, countriesItSelf){
console.log(name);
if(name == 'Vietnam'){
return false; //停止循环
}
});
*/
//案例二
var StudentsJSON = {
student:[{
name: '张三',
studentid: 200801,
grade: 80
},{
name: '李四',
studentid: 200802,
grade: 90
},{
name: '王五',
studentid: 200803,
grade: 90
},{
name: '李二麻子',
studentid: 200804,
grade: 90
}]
};
Ext.each(StudentsJSON.student, function(student, index, self){
console.log(student.name);
if(student.studentid == '200802'){
return false;
}
});
});
</script>