PDA

View Full Version : After grid edit, column value reverts to id, not name



zhegwood
23 Apr 2009, 2:07 PM
Here's the grid column. Basically, when I click the cell to edit, everything is fine. The combo is populated with the correct values, and selecting a value fires the select event.

In the select handler, I'm basically setting other values in the row to the value in the record that comes back. This also works, but once I tab off or click somewhere and the cell is taken out of edit mode, it the rate_name is changed to whatever value is in rate_id.

Anyway, the value of rate_name is correct up until I take it out of edit mode.



{
header: "Product/Service",
width: 100,
sortable: true,
dataIndex: 'rate_name',
editor: new Ext.form.ComboBox({
store: this.dsBillableMaterials,
name: 'billing_rate_name',
hiddenName: 'billing_rate_id',
displayField: 'rate_name',
valueField: 'rate_id',
mode: 'local',
forceSelection: true,
stateful: false,
triggerAction: 'all',
editable: false,
listeners: {
select: {
fn: function(obj,record,index) {
var row = this.getSelectionModel().getSelections()[0];
for (var a in row.data) {
if (record.data[a]) {
row.set(a, record.data[a]);
}
if (a === "qty") {
row.set(a, record.data['default_qty']);
}
}
this.dsBillableRecords.commitChanges();
console.log(this.dsBillableRecords);
},
scope: this
}
}
})
},

zhegwood
24 Apr 2009, 2:09 PM
Would it be possible to move this to the 2.0 forum... I didn't notice this was 3.0 until now.

Thanks.