Class StringFilterBuilder
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
StringFilterBuilder
ตัวสร้างตัวควบคุมตัวกรองสตริง
ตัวกรองสตริงคือช่องป้อนข้อความธรรมดาที่ช่วยให้ผู้ใช้กรองข้อมูลผ่านการจับคู่สตริงได้ เมื่อระบุคอลัมน์สตริงประเภทและตัวเลือกการจับคู่ การควบคุมนี้จะกรองแถวที่ไม่ตรงกับคำที่อยู่ในช่องป้อนข้อมูลออก
ดูรายละเอียดเพิ่มเติมได้ที่
เอกสารประกอบของ Gviz
เอกสารประกอบโดยละเอียด
setCaseSensitive(caseSensitive)
ตั้งค่าว่าควรจับคู่แบบคำนึงถึงตัวพิมพ์เล็กและตัวพิมพ์ใหญ่หรือไม่
// Builds a case insensitive string filter to filter column "Col1".
const stringFilter = Charts.newStringFilter()
.setFilterColumnLabel('Col1')
.setCaseSensitive(false)
.build();
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
caseSensitive | Boolean | หากเป็น true จะเปิดใช้การจับคู่สตริงที่คำนึงถึงตัวพิมพ์เล็กและตัวพิมพ์ใหญ่ |
รีเทิร์น
StringFilterBuilder
— ตัวสร้างนี้มีประโยชน์สำหรับการต่อเชื่อม
setMatchType(matchType)
ตั้งค่าว่าควรใช้การควบคุมเพื่อจับคู่ค่าที่ตรงกันทั้งหมดเท่านั้น (MatchType.EXACT
) คำนำหน้า (MatchType.PREFIX
) หรือสตริงย่อย (MatchType.ANY
)
// Builds a string filter to filter column "Col1" matching the prefix.
const stringFilter = Charts.newStringFilter()
.setFilterColumnLabel('Col1')
.setMatchType(Charts.MatchType.PREFIX)
.build();
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
matchType | MatchType | ประเภทการจับคู่สตริง |
รีเทิร์น
StringFilterBuilder
— ตัวสร้างนี้มีประโยชน์สำหรับการต่อเชื่อม
ดูเพิ่มเติม
setRealtimeTrigger(realtimeTrigger)
ตั้งค่าว่าการควบคุมควรจับคู่ทุกครั้งที่กดแป้นหรือเฉพาะเมื่อช่องป้อนข้อมูล "เปลี่ยนแปลง" (เสียโฟกัสหรือกดแป้น Enter)
// Builds a string filter to filter column "Col1" that checks the match any time
// a key is pressed.
const stringFilter = Charts.newStringFilter()
.setFilterColumnLabel('Col1')
.setRealtimeTrigger(true)
.build();
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
realtimeTrigger | Boolean | หากเป็น true ระบบจะตั้งค่าให้เหตุการณ์ทริกเกอร์แบบเรียลไทม์ (เมื่อมีการกดแป้น) |
รีเทิร์น
StringFilterBuilder
— ตัวสร้างนี้มีประโยชน์สำหรับการต่อเชื่อม
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eStringFilterBuilder helps create string filter controls for filtering data in Google Charts.\u003c/p\u003e\n"],["\u003cp\u003eIt offers options to control matching behavior, including case sensitivity, match type (exact, prefix, or any substring), and real-time triggering.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize the filter by setting properties like \u003ccode\u003ecaseSensitive\u003c/code\u003e, \u003ccode\u003ematchType\u003c/code\u003e, and \u003ccode\u003erealtimeTrigger\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe builder pattern allows for chaining methods for convenient and readable filter configuration.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the Gviz documentation for more in-depth information and examples.\u003c/p\u003e\n"]]],[],null,["# Class StringFilterBuilder\n\nStringFilterBuilder\n\nA builder for string filter controls.\n\nA string filter is a simple text input field that lets the user filter data via string\nmatching. Given a column of type string and matching options, this control filters out the rows\nthat don't match the term that's in the input field.\n\nFor more details, see the Gviz [documentation](https://developers.google.com/chart/interactive/docs/gallery/controls#stringfilter). \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------------------|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [setCaseSensitive(caseSensitive)](#setCaseSensitive(Boolean)) | [StringFilterBuilder](#) | Sets whether matching should be case sensitive or not. |\n| [setMatchType(matchType)](#setMatchType(MatchType)) | [StringFilterBuilder](#) | Sets whether the control should match exact values only ([MatchType.EXACT](/apps-script/reference/charts/match-type#EXACT)), prefixes starting from the beginning of the value ([MatchType.PREFIX](/apps-script/reference/charts/match-type#PREFIX)), or any substring ([MatchType.ANY](/apps-script/reference/charts/match-type#ANY)). |\n| [setRealtimeTrigger(realtimeTrigger)](#setRealtimeTrigger(Boolean)) | [StringFilterBuilder](#) | 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). |\n\nDetailed documentation\n----------------------\n\n### `set``Case``Sensitive(caseSensitive)`\n\nSets whether matching should be case sensitive or not.\n\n```javascript\n// Builds a case insensitive string filter to filter column \"Col1\".\nconst stringFilter = Charts.newStringFilter()\n .setFilterColumnLabel('Col1')\n .setCaseSensitive(false)\n .build();\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|-------------------|-----------|------------------------------------------------------|\n| `case``Sensitive` | `Boolean` | If `true`, enables string matching case sensitivity. |\n\n#### Return\n\n\n[StringFilterBuilder](#) --- This builder, useful for chaining.\n\n*** ** * ** ***\n\n### `set``Match``Type(matchType)`\n\nSets whether the control should match exact values only ([MatchType.EXACT](/apps-script/reference/charts/match-type#EXACT)), prefixes\nstarting from the beginning of the value ([MatchType.PREFIX](/apps-script/reference/charts/match-type#PREFIX)), or any substring\n([MatchType.ANY](/apps-script/reference/charts/match-type#ANY)).\n\n```javascript\n// Builds a string filter to filter column \"Col1\" matching the prefix.\nconst stringFilter = Charts.newStringFilter()\n .setFilterColumnLabel('Col1')\n .setMatchType(Charts.MatchType.PREFIX)\n .build();\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|---------------|-------------------------------------------------------|---------------------------|\n| `match``Type` | [MatchType](/apps-script/reference/charts/match-type) | The string matching type. |\n\n#### Return\n\n\n[StringFilterBuilder](#) --- This builder, useful for chaining.\n\n#### See also\n\n- [MatchType](/apps-script/reference/charts/match-type)\n\n*** ** * ** ***\n\n### `set``Realtime``Trigger(realtimeTrigger)`\n\nSets whether the control should match any time a key is pressed or only when the input field\n'changes' (loss of focus or pressing the Enter key).\n\n```javascript\n// Builds a string filter to filter column \"Col1\" that checks the match any time\n// a key is pressed.\nconst stringFilter = Charts.newStringFilter()\n .setFilterColumnLabel('Col1')\n .setRealtimeTrigger(true)\n .build();\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|---------------------|-----------|------------------------------------------------------------------------------|\n| `realtime``Trigger` | `Boolean` | If `true`, sets events to be triggered at real time (when a key is pressed). |\n\n#### Return\n\n\n[StringFilterBuilder](#) --- This builder, useful for chaining."]]