Return null for empty MultiSelection key of Dict widget
This is more consistent with the other widgets.
This commit is contained in:
@@ -5437,7 +5437,11 @@ function eval_pyson(value){
|
||||
},
|
||||
get_value: function() {
|
||||
var value = this.input.val();
|
||||
return value.map(function(e) { return JSON.parse(e); });
|
||||
if (value && value.length) {
|
||||
return value.map(function(e) { return JSON.parse(e); });
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
set_value: function(value) {
|
||||
if (value) {
|
||||
|
||||
@@ -233,7 +233,7 @@ class DictMultiSelectionEntry(DictEntry):
|
||||
|
||||
def get_value(self):
|
||||
model, paths = self.tree.get_selection().get_selected_rows()
|
||||
return [model[path][0] for path in paths]
|
||||
return [model[path][0] for path in paths] or None
|
||||
|
||||
def set_value(self, value):
|
||||
value2path = {v: idx for idx, (v, _) in enumerate(self.selection)}
|
||||
|
||||
Reference in New Issue
Block a user