diff --git a/frontend/src/ts/ervu/component/grid/filter/SetFilter.ts b/frontend/src/ts/ervu/component/grid/filter/SetFilter.ts index 0a439e24..acb458f8 100644 --- a/frontend/src/ts/ervu/component/grid/filter/SetFilter.ts +++ b/frontend/src/ts/ervu/component/grid/filter/SetFilter.ts @@ -24,8 +24,12 @@ export class SetFilter implements IFilterComp { this.selectAll = this.initCheckBox('selectAll', 'Все', index); this.checkboxes.push(this.selectAll); - params.api.getRenderedNodes() - .map(node => node.data[params.colDef.field]) + const allValues: any[] = []; + params.api.forEachNode((node) => { + allValues.push(node.data[params.colDef.field]); + }); + + allValues .sort((n1, n2) => n1 > n2 ? 1 : n1 < n2 ? -1 : 0) .forEach(value => { if (this.values.includes(value)) { @@ -36,7 +40,8 @@ export class SetFilter implements IFilterComp { let checkbox = this.initCheckBox(id, value, index); this.checkboxes.push(checkbox); this.values.push(value); - }); + }); + this.initialValues = this.values.slice(); this.filterParams = params; this.filterActive = false;