You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
afterSetRecord(value, oldValue) {
let me = this,
list = me.list,
selectionModel = list?.selectionModel,
valueField = me.valueField,
nodeId;
if (oldValue) {
nodeId = list?.getItemId(oldValue[valueField]);
selectionModel?.deselect(nodeId);
}
if (value) {
nodeId = list?.getItemId(value[valueField]);
selectionModel?.select(nodeId);
}
}
new code:
afterSetRecord(value, oldValue) {
if (this._picker?.isVisible) {
let me = this,
selectionModel = me.list?.selectionModel;
if (value) {
selectionModel?.select(value);
}
else {
selectionModel.deselectAll();
}
}
}
we need a merge of both. if we are switching from one record to another, the old selection should get removed (i would not assume that the selModel has singleSelection activated).
if there is no value, we need the deselectAll() call.
tobiu
changed the title
form.field.Select: afterSetValue() => removing old values from selections
form.field.Select: afterSetRecord() => removing old values from selections
Feb 20, 2024
old code:
new code:
we need a merge of both. if we are switching from one record to another, the old selection should get removed (i would not assume that the selModel has singleSelection activated).
if there is no value, we need the deselectAll() call.
@ExtAnimal
The text was updated successfully, but these errors were encountered: