Class StringFilterBuilder Stay organized with collections Save and categorize content based on your preferences.
Page Summary
StringFilterBuilder is a builder for string filter controls, which are simple text input fields used to filter data based on string matching in a specified column.
The
setCaseSensitive(caseSensitive)method allows you to determine if the string matching should be case sensitive.The
setMatchType(matchType)method lets you set whether the control should match exact values, prefixes, or any substring.The
setRealtimeTrigger(realtimeTrigger)method controls whether the filtering occurs as each key is pressed or only when the input field changes.
A builder for string filter controls.
A string filter is a simple text input field that lets the user filter data via stringmatching. Given a column of type string and matching options, this control filters out the rowsthat don't match the term that's in the input field.
For more details, see the Gvizdocumentation.
Methods
| Method | Return type | Brief description |
|---|---|---|
set | String | Sets whether matching should be case sensitive or not. |
set | String | Sets whether the control should match exact values only (Match), prefixesstarting from the beginning of the value (Match), or any substring(Match). |
set | String | Sets whether the control should match any time a key is pressed or only when the input field'changes' (loss of focus or pressing the Enter key). |
Detailed documentation
setCaseSensitive(caseSensitive)
Sets whether matching should be case sensitive or not.
// Builds a case insensitive string filter to filter column "Col1".conststringFilter=Charts.newStringFilter().setFilterColumnLabel('Col1').setCaseSensitive(false).build();
Parameters
| Name | Type | Description |
|---|---|---|
case | Boolean | Iftrue, enables string matching case sensitivity. |
Return
String — This builder, useful for chaining.
setMatchType(matchType)
Sets whether the control should match exact values only (Match), prefixesstarting from the beginning of the value (Match), or any substring(Match).
// Builds a string filter to filter column "Col1" matching the prefix.conststringFilter=Charts.newStringFilter().setFilterColumnLabel('Col1').setMatchType(Charts.MatchType.PREFIX).build();
Parameters
| Name | Type | Description |
|---|---|---|
match | Match | The string matching type. |
Return
String — This builder, useful for chaining.
See also
setRealtimeTrigger(realtimeTrigger)
Sets whether the control should match any time a key is pressed or only when the input field'changes' (loss of focus or pressing the Enter key).
// Builds a string filter to filter column "Col1" that checks the match any time// a key is pressed.conststringFilter=Charts.newStringFilter().setFilterColumnLabel('Col1').setRealtimeTrigger(true).build();
Parameters
| Name | Type | Description |
|---|---|---|
realtime | Boolean | Iftrue, sets events to be triggered at real time (when a key is pressed). |
Return
String — This builder, useful for chaining.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.