• 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}, "-"
                ]
            });
        });
  • 相关阅读:
    最小的K个数
    CentOS 7 连接不到网络解决方法
    数组中超过一半的数字
    字符串的排列
    二叉搜索树与双向链表
    复杂链表的复制
    二叉树中和为某一数值的路径
    二叉搜索树的后序遍历序列
    从上到下打印二叉树
    java的图形文档
  • 原文地址:https://www.cnblogs.com/lishupeng/p/10473738.html
Copyright © 2020-2023  润新知