billtricarico
29 Jun 2012, 11:45 AM
Hello,
I have added an editor to a column in my GridPanel:
{
xtype : 'combo',
triggerAction : 'all',
displayField : 'name',
valueField : 'id',
store: 'MyStore'
}
Now when I click to edit the cell or row, I make my selection from the combobox, and then update it. The rendered cell value is the 'id' field of my combo, and not the 'name' field. What is the best way to make the GridPanel show the 'name' field? Obviously I don't want to make 'id' and 'name' the same value...that would negate the point of having an id.
I'm keeping a hidden ID field on the GridPanel to match the 'id' field in the editor, and the editor is on the column that would map to the 'name' field. So when the edit is complete, the editor's selected record would populate the hidden ID, and the editing column would show the 'name' field in the renderer.
Thanks.
I have added an editor to a column in my GridPanel:
{
xtype : 'combo',
triggerAction : 'all',
displayField : 'name',
valueField : 'id',
store: 'MyStore'
}
Now when I click to edit the cell or row, I make my selection from the combobox, and then update it. The rendered cell value is the 'id' field of my combo, and not the 'name' field. What is the best way to make the GridPanel show the 'name' field? Obviously I don't want to make 'id' and 'name' the same value...that would negate the point of having an id.
I'm keeping a hidden ID field on the GridPanel to match the 'id' field in the editor, and the editor is on the column that would map to the 'name' field. So when the edit is complete, the editor's selected record would populate the hidden ID, and the editing column would show the 'name' field in the renderer.
Thanks.