Ox.FormPanel.values now accepts values too
This commit is contained in:
parent
ac1a4ef961
commit
49742b8b1a
1 changed files with 16 additions and 5 deletions
|
@ -191,13 +191,24 @@ Ox.FormPanel = function(options, self) {
|
||||||
values <f> values
|
values <f> values
|
||||||
@*/
|
@*/
|
||||||
that.values = function() {
|
that.values = function() {
|
||||||
|
if (arguments.length === 0) {
|
||||||
var values = {};
|
var values = {};
|
||||||
self.options.form.forEach(function(section, i) {
|
self.options.form.forEach(function(section, i) {
|
||||||
values[section.id] = self.$forms[i].values();
|
values[section.id] = self.$forms[i].values();
|
||||||
});
|
});
|
||||||
return 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;
|
return that;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue