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>
    

  • 相关阅读:
    出差常熟,郁闷中 沧海
    ABAP中程序之间传递参数的办法 沧海
    LSMW中出现No logical path specified. 沧海
    请认真对待生活 沧海
    escape sequence 沧海
    休假一周 沧海
    Print Program and Form Modify 沧海
    下周回南京 沧海
    LO020真麻烦 沧海
    函数讲解函数列表(ZT) 沧海
  • 原文地址:https://www.cnblogs.com/LY-CS/p/12713158.html
Copyright © 2011-2022 走看看