zoukankan      html  css  js  c++  java
  • Extjs——简单的Grid panel小实例

    <!DOCTYPE html>
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <title></title>
        <!--这三条是最基础需要用到的三条-->
        //设置风格
        <link href="extjs4.2/resources/ext-theme-neptune/ext-theme-neptune-all.css" 
        //重要的js文件
        <script src="extjs4.2/ext-all.js"></script>
        //风格文件需要用到的js文件
        <script src="extjs4.2/ext-theme-neptune.js"></script>rel="stylesheet" />
    </head>
    <body>
        <script>
            Ext.onReady(function () {
                //创建数据表
                Ext.create('Ext.data.Store', {
                    storeId: 'simpsonsStore',
                    //field填写字段名字
                    fields: ['name', 'email', 'phone'],
                    //保存数据的变量,本地数据,如果是从服务端获得数据,则在proxy中设置
                    data: {
                        'items': [
                            { 'name': 'Lisa', "email": "lisa@simpsons.com", "phone": "555-111-1224" },
                            { 'name': 'Bart', "email": "bart@simpsons.com", "phone": "555-222-1234" },
                            { 'name': 'Homer', "email": "home@simpsons.com", "phone": "555-222-1244" },
                            { 'name': 'Marge', "email": "marge@simpsons.com", "phone": "555-222-1254" }
                        ]
                    },
                    proxy: {
                        type: 'memory',
                        reader: {
                            type: 'json',
                            root: 'items'
                        }
                    }
                });
    
                //创建表格格式
                Ext.create('Ext.grid.Panel', {
                    title: 'Simpsons',
                    store: Ext.data.StoreManager.lookup('simpsonsStore'),
                    columns: [
                        { text: 'Name', dataIndex: 'name' },
                        { text: 'Email', dataIndex: 'email', flex: 1 },
                        { text: 'Phone', dataIndex: 'phone' }
                    ],
                    height: 200,
                     400,
                    renderTo: Ext.getBody()
                });
            })
        </script>
    </body>
    </html>
    

  • 相关阅读:
    TextView文字排版问题:
    Cent OS 6 主机名设置
    windows server 时间同步
    DELL服务器SAS 5 I_R 完全配置手册
    SAS 5/iR Adapter 驱动下载
    U盘加载硬盘控制卡驱动安装Windows 2003 指南
    邮件客户端导入邮件通讯录地址薄
    Symantec System Recovery
    windows server 备份与还原
    Acronis 备份使用
  • 原文地址:https://www.cnblogs.com/LY-CS/p/12713158.html
Copyright © 2011-2022 走看看