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:
@@ -45,6 +45,7 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
|
||||
format = '[{FROM} TO {TO}]';
|
||||
|
||||
isActive = false;
|
||||
startValue: any;
|
||||
|
||||
validators: Validators;
|
||||
|
||||
@@ -61,8 +62,13 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
|
||||
Validators.min(0)
|
||||
]);
|
||||
|
||||
this.from = new FormControl('', this.validators);
|
||||
this.to = new FormControl('', this.validators);
|
||||
if (this.startValue) {
|
||||
this.from = new FormControl(this.startValue['from'], this.validators);
|
||||
this.to = new FormControl(this.startValue['to'], this.validators);
|
||||
} else {
|
||||
this.from = new FormControl('', this.validators);
|
||||
this.to = new FormControl('', this.validators);
|
||||
}
|
||||
|
||||
this.form = new FormGroup({
|
||||
from: this.from,
|
||||
@@ -108,6 +114,15 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
|
||||
return this.form.valid;
|
||||
}
|
||||
|
||||
getCurrentValue() {
|
||||
return this.form.value;
|
||||
}
|
||||
|
||||
setValue(value: any) {
|
||||
this.form['from'].setValue(value);
|
||||
this.form['to'].setValue(value);
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.isActive = false;
|
||||
|
||||
|
Reference in New Issue
Block a user