update list items by id

This commit is contained in:
j 2019-01-31 14:22:20 +05:30
parent 8c0f68e2d5
commit d58f5bd61b
2 changed files with 7 additions and 8 deletions

View file

@ -314,7 +314,7 @@ oml.ui.folders = function() {
}; };
that.updateItems = function(items) { that.updateItems = function(list, items) {
var $list; var $list;
if (arguments.length == 0) { if (arguments.length == 0) {
oml.getLists(function(lists) { oml.getLists(function(lists) {
@ -326,12 +326,11 @@ oml.ui.folders = function() {
}); });
}); });
} else { } else {
$list = $lists.filter(function($list) { $lists.forEach(function($list) {
return $list.options('selected').length; if (!Ox.isEmpty($list.value(list))) {
})[0]; $list.value(list, 'items', items);
if ($list && !Ox.isEmpty($list.value(ui._list))) {
$list.value(ui._list, 'items', items);
} }
})
} }
}; };

View file

@ -64,7 +64,7 @@ oml.ui.list = function() {
&& ui.find.conditions[0].key == 'list' && ui.find.conditions[0].key == 'list'
&& ui.find.conditions[0].operator == '==' && ui.find.conditions[0].operator == '=='
)) { )) {
oml.$ui.folders.updateItems(data.items); oml.$ui.folders.updateItems(ui.find.conditions[0].value, data.items);
} }
oml.$ui.statusbar.set('total', data); oml.$ui.statusbar.set('total', data);
}, },