mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3506] - Filter are kept when reloaded (#5885)
* [ADF] - saving in the url the filter values * Fixed filter status on refresh * Fixed filter status on refresh * [ACA-3506] - added url filtering save * [ACA-3506] - fixed spellcheck * improve log * more log * fix scripts * Added documentation for allowUpdateOnChange setting * Added default value in description for docs Co-authored-by: Vito Albano <vitoalbano@Vitos-MacBook-Pro.local> Co-authored-by: Eugenio Romano <eugenio.romano@alfresco.com>
This commit is contained in:
@@ -47,6 +47,7 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
|
||||
options: SearchFilterList<SearchRadioOption>;
|
||||
pageSize = 5;
|
||||
isActive = false;
|
||||
startValue: any;
|
||||
|
||||
constructor() {
|
||||
this.options = new SearchFilterList<SearchRadioOption>();
|
||||
@@ -64,8 +65,11 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
|
||||
}
|
||||
|
||||
const initialValue = this.getSelectedValue();
|
||||
|
||||
if (initialValue !== null) {
|
||||
this.setValue(initialValue);
|
||||
} else if (this.startValue !== null) {
|
||||
this.setValue(initialValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,12 +97,16 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
|
||||
return !!currentValue;
|
||||
}
|
||||
|
||||
private setValue(newValue: string) {
|
||||
setValue(newValue: string) {
|
||||
this.value = newValue;
|
||||
this.context.queryFragments[this.id] = newValue;
|
||||
this.context.update();
|
||||
}
|
||||
|
||||
getCurrentValue() {
|
||||
return this.getSelectedValue();
|
||||
}
|
||||
|
||||
changeHandler(event: MatRadioChange) {
|
||||
this.setValue(event.value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user