[]
RowFilterBase
• new RowFilterBase(range?)
Represents a row filter base that supports row filters for filtering rows in a sheet.
| Name | Type | Description |
|---|---|---|
range? |
Range |
The filter range. |
• extendedRange: Range
Represents the extendedRange for the row filter.
• range: Range
Represents the range for the row filter.
• typeName: string
Represents the type name string used for supporting serialization.
▸ addFilterItem(col, condition): void
Adds a specified filter to the row filter.
| Name | Type | Description |
|---|---|---|
col |
number |
The column index. |
condition |
Condition |
The condition to filter. |
void
▸ filter(col?): void
Filters the specified column.
| Name | Type | Description |
|---|---|---|
col? |
number |
The index of the column to be filtered; if it is omitted, all the columns in the range will be filtered. |
void
▸ filterButtonVisible(col?, value?): any
Gets or sets whether the sheet column's filter button is displayed.
| Name | Type | Description |
|---|---|---|
col? |
number |
The column index of the filter button. |
value? |
boolean |
Whether the filter button is displayed. |
any
No parameter
▸ fromJSON(settings): void
Loads the object state from the specified JSON string.
| Name | Type | Description |
|---|---|---|
settings |
Object |
The row filter data from deserialization. |
void
▸ getFilterItems(col): Condition[]
Gets the filters for the specified column.
| Name | Type | Description |
|---|---|---|
col |
number |
The column index. |
Returns a collection that contains conditions that belong to a specified column.
▸ getFilteredItems(): Condition[]
Gets all the filtered conditions.
Returns a collection that contains all the filtered conditions.
▸ getSortState(col): SortState
Gets the current sort state.
| Name | Type | Description |
|---|---|---|
col |
number |
The column index. |
The sort state of the current filter.
▸ isFiltered(col?): boolean
Gets a value that indicates whether any row or specified column is filtered.
example
//This example uses the isFiltered method.
activeSheet.setValue(0, 0, "North");
activeSheet.setValue(1, 0, "South");
activeSheet.setValue(2, 0, "East");
activeSheet.setValue(3, 0, "South");
activeSheet.setValue(4, 0, "North");
activeSheet.setValue(5, 0, "North");
activeSheet.setValue(6, 0, "West");
activeSheet.setColumnWidth(0, 80);
//Set a row filter.
activeSheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(0, 0, 7, 1)));
//button
$("#button1").click(function () {
var rowFilter = spread.getActiveSheet().rowFilter();
if (rowFilter.isFiltered(0)) {
alert("Row-filtering executed for Column1");
} else {
alert("Row-filtering not executed for Column1");
}
});
//Add button control to page
<input type="button" id="button1" value="button1"/>
| Name | Type | Description |
|---|---|---|
col? |
number |
The column index. |
boolean
No parameter
▸ isRowFilteredOut(row): boolean
Determines whether the specified row is filtered out.
| Name | Type | Description |
|---|---|---|
row |
number |
The row index. |
boolean
▸ onFilter(args): void
Performs the action when some columns have just been filtered or unfiltered.
| Name | Type | Description |
|---|---|---|
args |
IFilteredArgs |
An object that contains the action, sheet, range, filteredRows, and filteredOutRows. See the Remarks for additional information. |
void
▸ openFilterDialog(filterButtonHitInfo): void
Opens the filter dialog when the user clicks the filter button.
| Name | Type | Description |
|---|---|---|
filterButtonHitInfo |
IFilterButtonHitInfo |
The hit test information about the filter button. |
void
▸ removeFilterItems(col): void
Removes the specified filter.
| Name | Type | Description |
|---|---|---|
col |
number |
The column index. |
void
▸ reset(): void
Clears all filters.
void
▸ sortColumn(col, ascending): void
Sorts the specified column in the specified order.
| Name | Type | Description |
|---|---|---|
col |
number |
The column index. |
ascending |
boolean |
Set to |
void
▸ toJSON(): Object
Saves the object state to a JSON string.
Object
The row filter data.
▸ unfilter(col?): void
Removes the filter from the specified column.
| Name | Type | Description |
|---|---|---|
col? |
number |
The index of the column for which to remove the filter; if it is omitted, removes the filter for all columns in the range. |
void