form elements rewrite, part 2
This commit is contained in:
parent
fe303bf2b0
commit
074902d079
33 changed files with 163 additions and 153 deletions
|
|
@ -16,8 +16,6 @@ Ox.ObjectInput = function(options, self) {
|
|||
height: self.options.elements.length * 24 - 8 + 'px'
|
||||
});
|
||||
|
||||
Ox.print('ObjI', self.options)
|
||||
|
||||
self.options.elements.forEach(function($element) {
|
||||
$element.options({
|
||||
labelWidth: self.options.labelWidth,
|
||||
|
|
@ -25,18 +23,22 @@ Ox.ObjectInput = function(options, self) {
|
|||
})
|
||||
.bindEvent({
|
||||
change: function(data) {
|
||||
// ...
|
||||
self.options.value = {};
|
||||
self.options.elements.forEach(function(element) {
|
||||
self.options.value[element.options('id')] = element.value();
|
||||
});
|
||||
that.triggerEvent('change', {
|
||||
value: self.options.value
|
||||
});
|
||||
}
|
||||
})
|
||||
.appendTo(that);
|
||||
});
|
||||
|
||||
that.value = function() {
|
||||
var value = {};
|
||||
self.options.elements.forEach(function(element) {
|
||||
value[element.options('id')] = element.value();
|
||||
});
|
||||
return value;
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'value') {
|
||||
// ...
|
||||
}
|
||||
};
|
||||
|
||||
return that;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue