ExtJS网格与分页,而不是组合框

ExtJS grid with pagination, instead of combobox

本文关键字:组合 网格 分页 ExtJS      更新时间:2023-09-26

我正在创建一个项目列表,这是在组合框,但我被要求创建它与网格,并包括分页。是否有可能创建一个网格的项目列表,然后选择他们喜欢下拉菜单(具有多选功能),当单击提交按钮获得值,并通过php文件处理它?

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

不管怎样,做这件事最好的方法是什么?如果这两种方法都不可能,我可以使用多选来制作列表吗?使用displayfield和valuefield?

你可以为网格中的每个项目添加复选框,然后对选中的项目做一些操作。

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);
    }
});

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