初探ext

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>02</title>
    <link href="Styles/resources/css/ext-all.css" rel="stylesheet" type="text/css" charset="utf-8" />
    <script src="Scripts/ext-all.js" charset="utf-8" language="javascript" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        Ext.application({
            name:'helloExt',
            launch:function(){
                Ext.create('Ext.container.Viewport',
                    {
                        layout: 'accordion',//布局有很多种,详情看api
                        items:
                            [
                                {
                                    title: '元素1',
                                    html: 'hello Welcome to Ext JS'
                                },
                                {
                                    title: '元素2',
                                    html: 'hello Welcome to Ext JS'
                                },
                                {
                                    title: '元素3',
                                    html: 'hello Welcome to Ext JS'
                                }
                            ]
                    });
            }
        });
        
        Ext.onReady(function(){
            Ext.get("Btn").on("click",function(){
                Ext.select("p").highlight();
            });
            
        });
    </script>
</head>
<body>
    <input type="button" value="click" id="Btn" />
    <p>1</p>
    <p>2</p>
</body>
</html>

今天早上了解了下ext大概的情况,顺便做了一个小例子。

posted on 2013-04-01 10:20  wp456  阅读(177)  评论(0)    收藏  举报

导航