extJs学习基础4 Ext.each的用法
1 Ext.onReady(function(){ 2 //案例一 3 /* 4 var countries = [‘Vietnam‘, ‘Singapore‘, ‘United States‘, ‘Russia‘]; 5 Ext.Array.each(countries, function(name, index, countriesItSelf){ 6 console.log(name); 7 if(name == ‘Vietnam‘){ 8 return false; //停止循环 9 } 10 }); 11 */ 12 //案例二 13 var StudentsJSON = { 14 student:[{ 15 name: ‘张三‘, 16 studentid: 200801, 17 grade: 80 18 },{ 19 name: ‘李四‘, 20 studentid: 200802, 21 grade: 90 22 },{ 23 name: ‘王五‘, 24 studentid: 200803, 25 grade: 90 26 },{ 27 name: ‘李二麻子‘, 28 studentid: 200804, 29 grade: 90 30 }] 31 }; 32 33 Ext.each(StudentsJSON.student, function(student, index, self){ 34 console.log(student.name); 35 if(student.studentid == ‘200802‘){ 36 return false; 37 } 38 }); 39 40 }); 41 </script>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。