PDA

View Full Version : How to add a ComboBox in Grid



keith.sutton@emc.com
1 Feb 2012, 1:23 PM
Hi everyone,

Would greatly appreciate a code example of how to put a combobox in a grid panel.

Thanks,
Keith

debabrata
1 Feb 2012, 9:46 PM
You can add a combobox in editor of a grid column.like this




{
id: 'PotentialforInsourcingKV',
header: 'Potential for Insourcing',
width: 30,
sortable: true,
dataIndex: 'POTENTIAL_FOR_INSOURCING',
flex: 1,
editor: {
xtype: 'combobox',
typeAhead: true,
triggerAction: 'all',
selectOnTab: true,
store: [
['1', 'Yes'],
['0', 'No']
],
lazyRender: true,
listClass: 'x-combo-list-small',
listeners:{
scope: this,
'select': function(combo, rec, idx){
onUpdateClick(combo, rec, idx)
}
}
}

},

skirtle
2 Feb 2012, 3:07 PM
An editor (either cell editor or row editor) is generally the best way but if you need the comboboxes to be present at all times you could use Component Column:

http://www.sencha.com/forum/showthread.php?148064

debabrata
2 Feb 2012, 8:52 PM
thanks skirtle (http://www.sencha.com/forum/member.php?197255-skirtle).

vietits
3 Feb 2012, 5:13 AM
You could also use Its.grid.column.Component (http://www.sencha.com/forum/showthread.php?174504-Its.grid.column.Component). With this component, you can render many kinds of component in the grid cell.