View Full Version : ComboBox value in a EditorGrid?

2 Aug 2007, 8:39 PM
How can I reference the value of a comboBox in an EditorGrid?


function getColumnModel() {
if(!columnModel) {
columnModel = new Ext.grid.ColumnModel(
header: 'Cuisine',
width: 125,
sortable: true,
dataIndex: 'cuisine_id',
editor: new Ext.grid.GridEditor(cbCuisine),
renderer: function(value, p, record){
return record.data['cuisine_name'];
return columnModel;

function buildGrid() {
gridForm = new Ext.BasicForm(


grid = new Ext.grid.EditorGrid(
ds: ds,
cm: getColumnModel(),
autoSizeColumns: false,
trackMouseOver: true,
selModel: new Ext.grid.RowSelectionModel({singleSelect:true})


I believe this code snippet is enough to help with the answer - if it's too short let me know.

Thanks in advance!

2 Aug 2007, 8:56 PM
If I'm right (and I may well not be... ;)), in the config for the combo box, you should have:
name: "fieldname"This tells the grid, and the form if you use it with that, the name of the field. From there you should be able to get the value.

2 Aug 2007, 10:35 PM
Thanks catacaustic!

Let me give that a shot!

3 Aug 2007, 12:44 AM
Here is a combobox example:

var combo = new Ext.form.ComboBox({
store: store,
displayField: 'name',
readOnly: true,
valueField: 'value',
loadingText: 'Loading data',
triggerAction: 'all',
mode: 'remote',
emptyText:'Selecteer name',

displayField is the value that you see in the combobox
valueField is the value of the selected field

(in HTML it's: <option value="valueField">displayField</option>)

to acces the values:

combo.getRawValue() = value of displayField
combo.getValue() = value of valueField

3 Aug 2007, 8:07 AM

The .getValue() is exactly what I was looking for.