Skip to content
Snippets Groups Projects
Commit 4bfa80a1 authored by tux091's avatar tux091
Browse files

Bug fixed: get values for fields embedded in composite field.

parent 051e6759
No related branches found
No related tags found
No related merge requests found
......@@ -290,7 +290,7 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, {
updateRecord: function (record) {
var combo,
combos,
fields,
i,
item,
rec,
......@@ -304,12 +304,22 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, {
}
}
// handle field embedded in composite fields
fields = this.findByType('compositefield');
for (i = 0; i < fields.length; i += 1) {
fields[i].items.eachKey(function(key, field) {
if (field.isDirty()) {
record.set(field.getName(), field.getValue());
}
});
}
// For foreign key, the record contains the valueField
// as well as the displayField. Previous action update the valueField
// but note the display field. The next line append the displayField
combos = this.findByType('xcombobox');
for (i = 0; i < combos.length; i += 1) {
combo = combos[i];
fields = this.findByType('xcombobox');
for (i = 0; i < fields.length; i += 1) {
combo = fields[i];
rec = combo.findRecord(combo.valueField, combo.getValue());
record.set(combo.displayField, rec.get(combo.displayField));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment