[]
        
(Showing Draft Content)

GC.Spread.Sheets.Filter.RowFilterBase

Class: RowFilterBase

Sheets.Filter.RowFilterBase

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new RowFilterBase(range?)

Represents a row filter base that supports row filters for filtering rows in a sheet.

Parameters

Name Type Description
range? Range The filter range.

Properties

extendedRange

extendedRange: Range

Represents the extendedRange for the row filter.


range

range: Range

Represents the range for the row filter.


typeName

typeName: string

Represents the type name string used for supporting serialization.

Methods

addFilterItem

addFilterItem(col, condition): void

Adds a specified filter to the row filter.

Parameters

Name Type Description
col number The column index.
condition Condition The condition to filter.

Returns

void


filter

filter(col?): void

Filters the specified column.

Parameters

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.

Returns

void


filterButtonVisible

filterButtonVisible(col?, value?): any

Gets or sets whether the sheet column's filter button is displayed.

Parameters

Name Type Description
col? number The column index of the filter button.
value? boolean Whether the filter button is displayed.

Returns

any

 No parameter `false` if all filter buttons are invisible; otherwise, `true`.
 One parameter col `false` if the specified column filter button is invisible; otherwise, `true`.
 One parameter value <c>GC.Spread.Sheets.Filter.RowFilterBase</c> sets all filter buttons to be visible(true)/invisible(false).
 Two parameters col,value <c>GC.Spread.Sheets.Filter.RowFilterBase</c> sets the specified column filter button to be visible(true)/invisible(false).

fromJSON

fromJSON(settings): void

Loads the object state from the specified JSON string.

Parameters

Name Type Description
settings Object The row filter data from deserialization.

Returns

void


getFilterItems

getFilterItems(col): Condition[]

Gets the filters for the specified column.

Parameters

Name Type Description
col number The column index.

Returns

Condition[]

Returns a collection that contains conditions that belong to a specified column.


getFilteredItems

getFilteredItems(): Condition[]

Gets all the filtered conditions.

Returns

Condition[]

Returns a collection that contains all the filtered conditions.


getSortState

getSortState(col): SortState

Gets the current sort state.

Parameters

Name Type Description
col number The column index.

Returns

SortState

The sort state of the current filter.


isFiltered

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
&lt;input type="button" id="button1" value="button1"/&gt;

Parameters

Name Type Description
col? number The column index.

Returns

boolean

No parameter true if some rows are filtered; otherwise, false. One parameter col true if the specified column is filtered; otherwise, false.


isRowFilteredOut

isRowFilteredOut(row): boolean

Determines whether the specified row is filtered out.

Parameters

Name Type Description
row number The row index.

Returns

boolean

true if the row is filtered out; otherwise, false.


onFilter

onFilter(args): void

Performs the action when some columns have just been filtered or unfiltered.

Parameters

Name Type Description
args IFilteredArgs An object that contains the action, sheet, range, filteredRows, and filteredOutRows. See the Remarks for additional information.

Returns

void


openFilterDialog

openFilterDialog(filterButtonHitInfo): void

Opens the filter dialog when the user clicks the filter button.

Parameters

Name Type Description
filterButtonHitInfo IFilterButtonHitInfo The hit test information about the filter button.

Returns

void


removeFilterItems

removeFilterItems(col): void

Removes the specified filter.

Parameters

Name Type Description
col number The column index.

Returns

void


reset

reset(): void

Clears all filters.

Returns

void


sortColumn

sortColumn(col, ascending): void

Sorts the specified column in the specified order.

Parameters

Name Type Description
col number The column index.
ascending boolean Set to true to sort as ascending.

Returns

void


toJSON

toJSON(): Object

Saves the object state to a JSON string.

Returns

Object

The row filter data.


unfilter

unfilter(col?): void

Removes the filter from the specified column.

Parameters

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.

Returns

void