form elements rewrite, part 2

This commit is contained in:
rolux 2011-12-21 21:03:52 +05:30
commit 074902d079
33 changed files with 163 additions and 153 deletions

View file

@ -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;