SUPPORT-9410: add cache clearValue
This commit is contained in:
parent
e1c4569a06
commit
1ca65aeb7d
2 changed files with 25 additions and 5 deletions
|
|
@ -282,6 +282,15 @@ export class DropdownTreeViewComponent extends InputControl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearValue() {
|
||||||
|
if (this.webbpmStorage) {
|
||||||
|
this.cachedValue = null;
|
||||||
|
this.webbpmStorage.delete(this.storageKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
super.clearValue();
|
||||||
|
}
|
||||||
|
|
||||||
onChange() {
|
onChange() {
|
||||||
super.onChange();
|
super.onChange();
|
||||||
this.valueChangeEvent.trigger(this.value);
|
this.valueChangeEvent.trigger(this.value);
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,20 @@ import {DropdownTreeViewComponent} from "../field/DropdownTreeViewComponent";
|
||||||
export class DropdownTreeViewFilterComponent extends FilterComponent {
|
export class DropdownTreeViewFilterComponent extends FilterComponent {
|
||||||
|
|
||||||
public isBusinessId: boolean;
|
public isBusinessId: boolean;
|
||||||
|
private treeViewComponent: DropdownTreeViewComponent;
|
||||||
|
|
||||||
|
initialize() {
|
||||||
|
super.initialize();
|
||||||
|
this.treeViewComponent = this.getScript(DropdownTreeViewComponent) as DropdownTreeViewComponent;
|
||||||
|
}
|
||||||
|
|
||||||
public getFilter(): Filter {
|
public getFilter(): Filter {
|
||||||
let treeViewComponent = this.getScript(DropdownTreeViewComponent) as DropdownTreeViewComponent;
|
let model = this.treeViewComponent.value;
|
||||||
let model = treeViewComponent.value;
|
|
||||||
|
|
||||||
if (!model && treeViewComponent.cachedValue) {
|
if (!model && this.treeViewComponent.cachedValue) {
|
||||||
let value = this.isBusinessId
|
let value = this.isBusinessId
|
||||||
? treeViewComponent.cachedValue.businessId
|
? this.treeViewComponent.cachedValue.businessId
|
||||||
: treeViewComponent.cachedValue.id;
|
: this.treeViewComponent.cachedValue.id;
|
||||||
return FilterUtil.singleValueFilter(this.getObjectId(), value, this.operation);
|
return FilterUtil.singleValueFilter(this.getObjectId(), value, this.operation);
|
||||||
}
|
}
|
||||||
else if (model) {
|
else if (model) {
|
||||||
|
|
@ -24,4 +29,10 @@ export class DropdownTreeViewFilterComponent extends FilterComponent {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
resetFilter(): Promise<void> | void {
|
||||||
|
this.treeViewComponent.clearValue();
|
||||||
|
return super.resetFilter();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue