@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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
_worksheet | Worksheet |
Returns
Overrides
Properties
Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
---|---|---|---|---|---|---|
_disposed | protected | boolean | false | - | Disposable ._disposed | core/src/shared/lifecycle.ts:96 |
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>
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
Parameter | Type |
---|---|
rows | Set <number > |
Returns
void
Methods
dispose()
dispose(): void
Defined in: sheets-filter/src/models/filter-model.ts:57
Returns
void
Overrides
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: core/src/shared/lifecycle.ts:103
Returns
void
Inherited from
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
Parameter | Type |
---|---|
index | number |
Returns
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
Parameter | Type |
---|---|
col | number |
Returns
Set
<number
>
getRange()
getRange(): IRange
Defined in: sheets-filter/src/models/filter-model.ts:117
Returns
isRowFiltered()
isRowFiltered(row): boolean
Defined in: sheets-filter/src/models/filter-model.ts:113
Parameters
Parameter | Type |
---|---|
row | number |
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
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
Parameter | Type | Default value |
---|---|---|
col | number | undefined |
criteria | Nullable <IFilterColumn > | undefined |
reCalc | boolean | false |
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
Parameter | Type |
---|---|
range | IRange |
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
Parameter | Type | Description |
---|---|---|
unitId | string | workbook id |
subUnitId | string | worksheet id |
worksheet | Worksheet | the Worksheet object |
autoFilter | IAutoFilter | auto filter data |