improve listmap editing functionality
This commit is contained in:
parent
76606689d7
commit
02442a24f7
6 changed files with 81 additions and 56 deletions
|
|
@ -132,9 +132,14 @@ Ox.ArrayInput = function(options, self) {
|
|||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'value') {
|
||||
return Ox.map(self.$input, function($input) {
|
||||
var value = $input.value();
|
||||
return value === '' ? null : value;
|
||||
if (self.options.value.length == 0) {
|
||||
self.options.value = [''];
|
||||
}
|
||||
self.$input && self.$input.forEach(function($input, i) {
|
||||
removeInput(i);
|
||||
});
|
||||
self.options.value.forEach(function(value, i) {
|
||||
addInput(i, value);
|
||||
});
|
||||
} else if (key == 'width') {
|
||||
setWidths();
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ Ox.Form = function(options, self) {
|
|||
} else {
|
||||
Ox.forEach(arguments[0], function(value, key) {
|
||||
var index = getItemIndexById(key);
|
||||
//index > -1 && Ox.print(key, value)
|
||||
index > -1 && Ox.print(':::::::', key, value)
|
||||
index > -1 && self.options.items[index].options({value: value});
|
||||
});
|
||||
return that;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue