【问题标题】:ExtJS grid with pagination, instead of combobox带有分页的 ExtJS 网格,而不是组合框
【发布时间】:2011-08-04 19:03:07
【问题描述】:

我正在创建组合框中的项目列表,但我被要求使用网格创建它并包含分页。是否可以创建一个包含项目列表的网格,然后像在下拉菜单中一样选择它们(具有多选功能),然后在单击提交按钮时获取值并通过 php 文件进行处理。?

我的想法:网格用于显示信息列表,网格中的文本可以是链接文本。但据我所知,您无法从网格中选择项目,然后通过单击提交按钮进行处理。

无论如何,最好的方法是什么?如果这两种方法都不可能,我可以使用多选来制作列表吗?有displayfield和valuefield吗?

【问题讨论】:

    标签: javascript extjs combobox grid multi-select


    【解决方案1】:

    好吧,您可以为网格中的每个项目添加复选框,然后对选定的项目执行一些操作。

    Ext.define('Your.items.Grid' ,{
        extend: 'Ext.grid.Panel',
    
        title : 'Grid with checkboxes',
        store: 'Items',
        // This line adds checkboxes
        selModel: Ext.create('Ext.selection.CheckboxModel'), 
    
        columns: [
             // Some columns here
        ],    
        initComponent: function() {
    
            this.dockedItems = [{
                xtype: 'toolbar',
                items: [{
                    itemId: 'process',
                    text: 'Process',
                    action: 'process' // Bind to some action and then process
                }]
            },
            { // Here is pagination
                xtype: 'pagingtoolbar',
                dock:'top',
                store: 'Items',
                displayInfo: true,
                displayMsg: 'Displaying items {0} - {1} of {2}',
                emptyMsg: "No items to display"
            }];            
            this.callParent(arguments);
        }
    });
    

    希望我能正确理解你的问题

    【讨论】:

    • 感谢回复我相信它很有用,但我对extjs不太先进,必须用列表来完成
    猜你喜欢
    • 2017-01-31
    • 1970-01-01
    • 1970-01-01
    • 2017-05-25
    • 2015-07-24
    • 2014-08-12
    • 1970-01-01
    • 2014-11-13
    • 2014-05-07
    相关资源
    最近更新 更多