ExtJs之Ext.each


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

<!DOCTYPE html>

<html>

<head>

    <title>ExtJs</title>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <link rel="stylesheet" type="text/css" href="ExtJs/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css">

        <script type="text/javascript" src="ExtJs/ext-all.js"></script>

        <script type="text/javascript" src="ExtJs/bootstrap.js"></script>

        <script type="text/javascript" src="ExtJs/packages/ext-theme-crisp/build/ext-theme-crisp.js"></script>

 

    <script type="text/javascript">

            Ext.onReady(function(){

        var panel = new Ext.Panel({

          title: 'SAMPLE',

          renderTo: 'sub1',

          width: '300px',

          html: '<div style="height:160px"></div>'

        });

        var array = [], i;

        for(i=0;i<10;i++){

          array.push(i);

        }

        function fn(item, index, allItems){

          if(item>5){

            return false;

          }else{

            allItems[index] = item + "_st"

          }

        }

        function fn1(item, index, allItems){

          if(index>0)

          return false;

          Ext.Msg.alert("最后的处理结果",

          "<div style='width:160px'>最后的集合为:" + allItems +"</div>");

        }

        Ext.each(array, fn);

        Ext.each(array, fn1);

      });

    </script>

</head>

<body>

<div id=sub1></div>

</body>

</html>

  

时间: 2024-12-22 00:12:52

ExtJs之Ext.each的相关文章

ExtJS之Ext.getDom

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <!DOCTYPE html> <html> <head>     <title>ExtJs</title>         <meta http-equiv="Content-Type" content="text/html; charset=utf

ExtJs之Ext.util.TaskRunner

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 <!DOCTYPE html> <html> <head>     <title>ExtJs</title>         <meta http-equiv="Content-Type" content="text/html; charset=utf-8&quo

ExtJs之Ext.comboBox的远程数据源读取程序

既然可以测试本地AJAX,那就把书前面的代码作一次学习吧. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 <!DOCTYPE html> <html>

ExtJs之Ext.XTemplate:数组填充,访问父对象

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 <!DOCTYPE html> <html> <head>     <title>ExtJs</title>         

EXTJS之Ext.util.Observable自定义事件

暂时还不会用Ext.mixin.Observable, 催悲的测试了近两个小时.这TMD的语法差距也太大了啊.. 在新版EXTJS里,已去除了addEvents. 弄个出来,大概知道下吧. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 <!DOCTYPE html> <html> <

ExtJs之Ext.grid.GridPanel(部分未完)

今天在家休息,年假不用就作费啊. 看了几部香港老电影,陪爸爸看了勇士占奇才, 然后,测试了一下EXTJS未完的内容, 在京东上订了七本历史普及书,近两百块..:) 搞定. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

ExtJs之Ext.XTemplate:模板成员函数

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 <!DOCTYPE html> <html> <head>     <title>ExtJs</title>         <

ExtJs之Ext.view.View

要注意MODEL的定义和实例化的代码,注释掉的是老式的不兼容4.0以上的.而下面的定义才是新推荐的. 我网上可是查的了.是书上的代码老了. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 6

ExtJs之Ext.Model的MemoryProxy

书上的代码已完全不可参考,只好按知识点从网上查资料一个一个实例 了. <!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type=&qu