[]
↳ HideRowFilter
• new HideRowFilter(range?
)
Represents a default row filter.
example
//The following example creates a new filter.
sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(0,0,4,4)));
sheet.repaint();
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 `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).
RowFilterBase.filterButtonVisible
▸ filterDialogVisibleInfo(visibleInfo?
): any
Gets or sets the visible info for the row filter.
example
//This example creates a row filter.
sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(1,1,10,3)));
var filter = sheet.rowFilter();
filter.filterDialogVisibleInfo({
sortByValue : false,
sortByColor : true,
filterByColor : true,
filterByValue : true,
listFilterArea : false
})
Name | Type | Description |
---|---|---|
visibleInfo? |
IFilterDialogVisibleInfo |
The visible info for row filter. |
any
If no value is set filter dialog visible info; otherwise, returns the HideRowFilter.
▸ 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.
RowFilterBase.getFilteredItems
▸ 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 true
if some rows are filtered; otherwise, false
.
One parameter col true
if the specified column is filtered; otherwise, false
.
▸ isRowFilteredOut(row
): boolean
Determines whether the specified row is filtered out.
Name | Type | Description |
---|---|---|
row |
number |
The row index. |
boolean
true
if the row is filtered out; otherwise, false
.
RowFilterBase.isRowFilteredOut
▸ 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
RowFilterBase.openFilterDialog
▸ removeFilterItems(col
): void
Removes the specified filter.
Name | Type | Description |
---|---|---|
col |
number |
The column index. |
void
RowFilterBase.removeFilterItems
▸ 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 true to sort as ascending. |
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