开发者

ExtJS grid with pagination, instead of combobox

开发者 https://www.devze.com 2023-03-26 04:03 出处:网络
I am creating a list of items, that are in combobox, but I am asked to create it with grid and to include pagination. Is it possible to create a grid with list of items, and then select them like in d

I am creating a list of items, that are in combobox, but I am asked to create it with grid and to include pagination. Is it possible to create a grid with list of items, and then select them like in dropdown menu (with multiselect feature) and when clicked a submit button get the values and process it through php file.?

My thoughts: Grid is for displaying list of information, and the text in grid can be link text. But as far as I know you can't select item from grid then process by clicking submit buttons.

Anyways, whats the best way of doing it? An开发者_如何学God if its not possible with neither one of the methods, can I use multiselect to make the list? With displayfield and valuefield?


Well, you can add checkbox to each item in grid and then do some action to selected items.

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

Hope I understood your question correctly

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号