Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add combo box editor in grid header in ExtJS

Tags:

extjs

extjs4

Can we add combo box in grid header in extjs ?

we have a special requirement here, if anybody has idea then please let me know.

Thanks Deepak

like image 311
Deepak Patil Avatar asked Mar 24 '23 09:03

Deepak Patil


2 Answers

If you want it in the grid column header (for example to implement custom filters), look at http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/build/KitchenSink/ext-theme-neptune/#big-data-grid

Basically, you configure items in the column configuration and off you go:

Ext.define('KitchenSink.view.grid.BigData', {
    extend: 'Ext.grid.Panel',
    columns: [
        {
            xtype: 'gridcolumn',
            dataIndex: 'status',
            text: 'Item status'
            items: [
                {xtype: 'combobox'}
            ]

        }
    ]
});
like image 156
Richard Laffers Avatar answered Mar 26 '23 00:03

Richard Laffers


You can use extjs tbar to implement components to grid header:

tbar: [
   { xtype: 'button', text: 'Button 1' }
]

or:

dockedItems: [{
    xtype: 'toolbar',
    dock: 'top',
    items: [
         { xtype: 'button', text: 'Button 1' }
    ]
}]

to implement combobox, best way is to define custom combobox component and provide alias for it, then in your grid tbar just say xtype: 'mygridcombo'

Here is a example.

like image 24
Davor Zubak Avatar answered Mar 26 '23 01:03

Davor Zubak