getShowIndex
Method | getShowIndex() | Get the positioning index of the tab page being displayed |
---|---|---|
Parameter | - | - |
Return value | number | The positioning index of the current tab page, number, starting from 0 |
Example | Example 1: If the obtained tabpane object is defined as tab , obtain the positioning index of the currently displayed Tab page Example 2: Obtain the positioning index of the tab page currently displayed by the tabpane0 Tab block in the dashboard _g().getWidgetByName("tabpane0").getShowIndex(); | |
Application example | Customize a button "View Tab Index", click the button to view the current Tab page and the positioning index of the Tab page: Click to download the template: | |
Mobile | Support mobile terminal |
setTabVisible
Method | setTabVisible(name, visibility) | Set a tab page to show/hide |
---|---|---|
Parameter | name: string visibility: boolean | string:Tab page component name, string visibility:Whether the tab page is displayed, boolean
|
Return value | - | - |
Example | Example 1: If the obtained tabpane object is defined as tab , hide the tab page whose component name is "Tab1"
Example 2: Hide the tab page with the component name "Tab1" in the tabpane0 Tab block in the decision report _g().getWidgetByName("tabpane0").setTabVisible("Tab2",false); | |
Application example | Customize a button "Hide Inventory Analysis", and hide the tab page titled "Inventory Analysis" when the button is clicked: Click to download the template: | |
Mobile | Support mobile terminal |
setTitleVisible
Method | setTitleVisible(visibility) | Set Tab block title to show/hide |
---|---|---|
Parameter | visibility: boolean | Whether the tab block title is displayed, boolean
|
Return value | - | - |
Example | Example 1: If the obtained tablayout object is defined as tab , hide the titles of all Tab pages, that is, the title of the Tab block
Example 2: Hide the title of the Tab block corresponding to tablayout0 in the dashboard _g().getWidgetByName("tablayout0").setTitleVisible(false); | |
Application example | Customize a button "Hide Tab Block Title" to hide the title of the Tab block when the button is clicked: Click to download the template: | |
Mobile | Support mobile terminal |
showCardByIndex
Method | showCardByIndex(index) | Show Nth Tab Page |
---|---|---|
Parameter | index: number | The number of tab pages, numbers, starting from 0 |
Return value | - | - |
Example | Example 1: If the obtained tabpane object is defined as tab , display the second Tab page
Example 2: The second tab page of the tab block corresponding to tablayout0 is displayed in the dashboard _g().getWidgetByName("tabpane0").showCardByIndex(1); | |
Application example | Customize a button "Display the second Tab page", and display the second Tab page when the button is clicked: Click to download the template: | |
Mobile | Support mobile terminal |