PDA

View Full Version : problem setting a sibling textField from a ComboBox selection



JKeane
19 Nov 2009, 8:41 AM
Here's the setup:


Within an EditorGridPanel, a the ComboBox is expanded.
The ComboBox refreshes its store, which consists of a numerical sequence, a string that's the description of the sequence, and a third numerical value (an associated fee) that will populate another field upon selection.
The ComboBox has a "select" listener, which I outline below.




//feeColID is defined outside of this code block.
select: function(cbox,r,i) {
grid = Ext.ComponentMgr.get(gridID);
fee = cbox.getStore().getAt(i).get("feeValue");
//update field
row = grid.getSelectionModel().getSelectedCell()[0];
col = grid.getColumnModel().getIndexById(feeColID);
feeCol = grid.getColumnModel().getColumnById(feeColID);
feeField = feeCol.getCellEditor(row,col);
feeField.setValue(fee);
feeField.completeEdit();
}


Here's the problem. I can get the fee from the store, the cell I intend to update, and the Editor for the cell. However, the setValue()/completeEdit() combo doesn't update the field. Any ideas?

carol.ext
19 Nov 2009, 12:32 PM
Update the record, not the editor.

JKeane
19 Nov 2009, 1:01 PM
Awesome, that worked! I didn't realize changes to the store would automatically bubble up to the UI layer. Thanks for the tip!