zoukankan      html  css  js  c++  java
  • extjs grid demo

    Ext.onReady(function () {
            var store = Ext.create('Ext.data.Store', {
                fields: ['id', 'name', 'account', 'password'],
                pageSize: 20,
                remoteSort: false,
                remoteFilter: true,
                proxy: {
                    type: 'ajax',
                    actionMethods: {
                        read: 'POST'
                    },
                    url: h.url + '/t/100',
                    reader: {
                        type: 'json',
                        root: 'rows',
                        totalProperty: 'total'
                    }
                },
                autoLoad: true
            });
            var grid = Ext.create('Ext.grid.Panel', {
                renderTo: Ext.getBody(),
                title: '用户列表',
                store: store,
                 800,
                height: 400,
                margin: 20,
                columns: [
                    {text: 'id', dataIndex: 'id'},
                    {text: 'name', dataIndex: 'name', flex: 1},
                    {text: 'account', dataIndex: 'account'},
                    {text: 'password', dataIndex: 'password'}
                ],
                bbar: [
                    {
                        xtype: 'pagingtoolbar',
                        store: store,
                        displayMsg: '显示 {0} - {1} 条,共计 {2} 条',
                        emptyMsg: "没有数据",
                        beforePageText: "当前页",
                        afterPageText: "共{0}页",
                        displayInfo: true
                    }
                ],
                tbar: [
                    {text: '新增', iconCls: 'add', handler: add}, "-",
                    {text: '编辑', iconCls: 'edit', handler: edit}, "-",
                    {text: '删除', iconCls: 'delete', handler: del}, "-"
                ]
            });
        });
  • 相关阅读:
    vim操作
    git命令
    Python笔记(二)
    python笔记
    gdb笔记 ---《Linux.C编程一站式学习》
    python笔记——dict和set
    echo $?
    FastDFS与Nginx环境配置
    Nginx依赖库安装
    mixin多继承包装过程
  • 原文地址:https://www.cnblogs.com/lishupeng/p/10473738.html
Copyright © 2011-2022 走看看