@univerjs/sheets-filter v0.5.4


Class: FilterModel

Defined in: sheets-filter/src/models/filter-model.ts:29

This is the in-memory model of filter.

Extends

Constructors

new FilterModel()

new FilterModel(
   unitId, 
   subUnitId, 
   _worksheet): FilterModel

Defined in: sheets-filter/src/models/filter-model.ts:49

Parameters

ParameterType
unitIdstring
subUnitIdstring
_worksheetWorksheet

Returns

FilterModel

Overrides

Disposable.constructor

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
_disposedprotectedbooleanfalse-Disposable._disposedcore/src/shared/lifecycle.ts:96
filteredOutRows$readonlyObservable<Readonly<Set<number>>>undefinedAn observable value. A set of filtered out rows.-sheets-filter/src/models/filter-model.ts:32
hasCriteria$readonlyObservable<boolean>undefined--sheets-filter/src/models/filter-model.ts:41
subUnitIdreadonlystringundefined--sheets-filter/src/models/filter-model.ts:51
unitIdreadonlystringundefined--sheets-filter/src/models/filter-model.ts:50

Accessors

filteredOutRows

Get Signature

get filteredOutRows(): Set<number>

Defined in: sheets-filter/src/models/filter-model.ts:33

Returns

Set<number>

Set Signature

set filteredOutRows(rows): void

Defined in: sheets-filter/src/models/filter-model.ts:34

Parameters
ParameterType
rowsSet<number>
Returns

void

Methods

dispose()

dispose(): void

Defined in: sheets-filter/src/models/filter-model.ts:57

Returns

void

Overrides

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


getAllFilterColumns()

getAllFilterColumns(): [number, FilterColumn][]

Defined in: sheets-filter/src/models/filter-model.ts:190

Returns

[number, FilterColumn][]


getFilterColumn()

getFilterColumn(index): Nullable<FilterColumn>

Defined in: sheets-filter/src/models/filter-model.ts:194

Parameters

ParameterType
indexnumber

Returns

Nullable<FilterColumn>


getFilteredOutRowsExceptCol()

getFilteredOutRowsExceptCol(col): Set<number>

Defined in: sheets-filter/src/models/filter-model.ts:130

Get filtered out rows except the specific column. This method is considered as “pure”. In another word it would not change filteredOutRows on FilterModel nor FilterColumn.

Parameters

ParameterType
colnumber

Returns

Set<number>


getRange()

getRange(): IRange

Defined in: sheets-filter/src/models/filter-model.ts:117

Returns

IRange


isRowFiltered()

isRowFiltered(row): boolean

Defined in: sheets-filter/src/models/filter-model.ts:113

Parameters

ParameterType
rownumber

Returns

boolean


reCalc()

reCalc(): void

Defined in: sheets-filter/src/models/filter-model.ts:198

Returns

void


serialize()

serialize(): IAutoFilter

Defined in: sheets-filter/src/models/filter-model.ts:67

Serialize this filter model to the JSON format representation.

Returns

IAutoFilter


setCriteria()

setCriteria(
   col, 
   criteria, 
   reCalc): void

Defined in: sheets-filter/src/models/filter-model.ts:165

Set or remove filter criteria on a specific row.

Parameters

ParameterTypeDefault value
colnumberundefined
criteriaNullable<IFilterColumn>undefined
reCalcbooleanfalse

Returns

void


setRange()

setRange(range): void

Defined in: sheets-filter/src/models/filter-model.ts:144

Set range of the filter model, this would remove some IFilterColumn if the new range not overlaps the old range.

Parameters

ParameterType
rangeIRange

Returns

void


deserialize()

static deserialize(
   unitId, 
   subUnitId, 
   worksheet, 
   autoFilter): FilterModel

Defined in: sheets-filter/src/models/filter-model.ts:89

Deserialize auto filter info to construct a FilterModel object.

Parameters

ParameterTypeDescription
unitIdstringworkbook id
subUnitIdstringworksheet id
worksheetWorksheetthe Worksheet object
autoFilterIAutoFilterauto filter data

Returns

FilterModel