@univerjs/sheets-filter v0.5.0-beta.1Docs


Class: FilterModel

This is the in-memory model of filter.

Extends

Constructors

new FilterModel()

new FilterModel(
   unitId, 
   subUnitId, 
   _worksheet): FilterModel

Parameters

ParameterType
unitIdstring
subUnitIdstring
_worksheetWorksheet

Returns

FilterModel

Overrides

Disposable.constructor

Defined in

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

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
_disposedprotectedbooleanfalse-Disposable._disposedcore/src/shared/lifecycle.ts:93
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>
Returns

Set<number>

Set Signature

set filteredOutRows(rows): void
Parameters
ParameterType
rowsSet<number>
Returns

void

Defined in

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

Methods

dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

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


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

core/src/shared/lifecycle.ts:96


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

core/src/shared/lifecycle.ts:100


getAllFilterColumns()

getAllFilterColumns(): [number, FilterColumn][]

Returns

[number, FilterColumn][]

Defined in

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


getFilterColumn()

getFilterColumn(index): Nullable<FilterColumn>

Parameters

ParameterType
indexnumber

Returns

Nullable<FilterColumn>

Defined in

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


getFilteredOutRowsExceptCol()

getFilteredOutRowsExceptCol(col): Set<number>

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>

Defined in

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


getRange()

getRange(): IRange

Returns

IRange

Defined in

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


isRowFiltered()

isRowFiltered(row): boolean

Parameters

ParameterType
rownumber

Returns

boolean

Defined in

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


reCalc()

reCalc(): void

Returns

void

Defined in

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


serialize()

serialize(): IAutoFilter

Serialize this filter model to the JSON format representation.

Returns

IAutoFilter

Defined in

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


setCriteria()

setCriteria(
   col, 
   criteria, 
   reCalc): void

Set or remove filter criteria on a specific row.

Parameters

ParameterTypeDefault value
colnumberundefined
criteriaNullable<IFilterColumn>undefined
reCalcbooleanfalse

Returns

void

Defined in

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


setRange()

setRange(range): void

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

Defined in

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


deserialize()

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

Deserialize auto filter info to construct a FilterModel object.

Parameters

ParameterTypeDescription
unitIdstringworkbook id
subUnitIdstringworksheet id
worksheetWorksheetthe Worksheet object
autoFilterIAutoFilterauto filter data

Returns

FilterModel

Defined in

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