Ox.FormPanel.values now accepts values too

This commit is contained in:
j 2023-09-03 11:24:01 +01:00
parent ac1a4ef961
commit 49742b8b1a

View file

@ -191,13 +191,24 @@ Ox.FormPanel = function(options, self) {
values <f> values
@*/
that.values = function() {
var values = {};
self.options.form.forEach(function(section, i) {
values[section.id] = self.$forms[i].values();
});
return values;
if (arguments.length === 0) {
var values = {};
self.options.form.forEach(function(section, i) {
values[section.id] = self.$forms[i].values();
});
return values;
} else {
var sections = arguments[0];
self.options.form.forEach(function(form, i) {
if ((form.id in sections) {
self.$forms[i].values(sections[form.id]);
}
});
}
};
return that;
};