Add combo box editor in grid header in ExtJS

Is it possible to add a combo box in the grid header in extjs?

we have a special requirement, if anyone has an idea, please let me know.

Thanks Deepak

+4
source share
4 answers

If you want a grid column header (for example, to create custom filters), see http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/build/KitchenSink/ext-theme-neptune/# big-data-grid

Basically, you are setting items in the column configuration and you can:

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

You can use extjs tbar to implement components in the 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 a custom combobox component and provide alias for it, then in your tbar grid just say xtype: 'mygridcombo'

Here is an example.

+2
source

This works well for me.

  { text : 'Save Energy Mode', dataIndex: 'fs', items: [{ xtype: 'combobox', padding: 2, flex: 1 }] } 

or just (if you do not need the title text)

  columns: { items: [{ xtype: 'combobox'}] } 
+1
source

If you can use it on a grid toolbar, then the Davor clause is the way to go. If you really need this in the grid header (for example, for filtering by columns), you can check the example of filtering the grid in Ext JS documents: http://docs.sencha.com/extjs/4.2.1/#!/example/grid -filtering / grid-filter-local.html

0
source

Source: https://habr.com/ru/post/1488671/


All Articles