extJs 학습기초4 Ext.each의 용법

4635 단어 ExtJs
 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>

좋은 웹페이지 즐겨찾기