extJs学习基础4 Ext.each的用法

 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>
上一篇:jQuery---jq基础了解(语法,特性),JQ和JS的区别对比,JQ和JS相互转换,Jquery的选择器(基础选择器,层级选择器,属性选择器),Jquery的筛选器(基本筛选器,表单筛选器),Jquery筛选方法


下一篇:05.Eclipse下Ndk开发(增量更新)