@univerjs/sheets-filter v0.5.0-beta.1 • Docs
Class: FilterModel
This is the in-memory model of filter.
Extends
Constructors
new FilterModel()
new FilterModel(
unitId,
subUnitId,
_worksheet): FilterModel
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
_worksheet | Worksheet |
Returns
Overrides
Defined in
sheets-filter/src/models/filter-model.ts:49
Properties
Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
---|---|---|---|---|---|---|
_disposed | protected | boolean | false | - | Disposable ._disposed | core/src/shared/lifecycle.ts:93 |
filteredOutRows$ | readonly | Observable <Readonly <Set <number >>> | undefined | An observable value. A set of filtered out rows. | - | sheets-filter/src/models/filter-model.ts:32 |
hasCriteria$ | readonly | Observable <boolean > | undefined | - | - | sheets-filter/src/models/filter-model.ts:41 |
subUnitId | readonly | string | undefined | - | - | sheets-filter/src/models/filter-model.ts:51 |
unitId | readonly | string | undefined | - | - | 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
Parameter | Type |
---|---|
rows | Set <number > |
Returns
void
Defined in
sheets-filter/src/models/filter-model.ts:33
Methods
dispose()
dispose(): void
Returns
void
Overrides
Defined in
sheets-filter/src/models/filter-model.ts:57
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
core/src/shared/lifecycle.ts:96
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
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
Parameter | Type |
---|---|
index | number |
Returns
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
Parameter | Type |
---|---|
col | number |
Returns
Set
<number
>
Defined in
sheets-filter/src/models/filter-model.ts:130
getRange()
getRange(): IRange
Returns
Defined in
sheets-filter/src/models/filter-model.ts:117
isRowFiltered()
isRowFiltered(row): boolean
Parameters
Parameter | Type |
---|---|
row | number |
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
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
Parameter | Type | Default value |
---|---|---|
col | number | undefined |
criteria | Nullable <IFilterColumn > | undefined |
reCalc | boolean | false |
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
Parameter | Type |
---|---|
range | IRange |
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
Parameter | Type | Description |
---|---|---|
unitId | string | workbook id |
subUnitId | string | worksheet id |
worksheet | Worksheet | the Worksheet object |
autoFilter | IAutoFilter | auto filter data |
Returns
Defined in
sheets-filter/src/models/filter-model.ts:89