Successfully!

Error!

FVS - Tab Component API

  • Last update:  2024-02-27
  • This document is applicable to users who have installed the FineVis Data Visualization plugin to learn plugin functions.

    Version

    Report Server VersionPlugin VersionFunctional Change
    11.0.9V1.9.1The FVS Tab component supported the getShowIndex() and showCardByIndex() interfaces.
    11.0.9V1.10.1Supported the setTabVisible interface.

    getShowIndex 

    Method
    getShowIndex()

    Get the index of the currently displayed tab page in the Tab component.

    Parameter--
    Returned ValuenumberThe location index (number) of the current tab page of the Tab component, starting from 0.
    Example

    Example One: Get the index of the currently displayed tab page in the Tab1 component in an FVS template.

    duchamp.getWidgetByName('Tab1').getShowIndex();

    Example Two: Get the index of the currently displayed tab page in the Tab1 component in an FVS template and display a pop-up message.

    var a=duchamp.getWidgetByName('Tab1').getShowIndex();
    duchamp.Msg.alert({
          title: "Prompt" ,
          message:"The "+(a+1)+" tab page is displayed in the Tab currently, and the index is"+a
    }
    )
    Application ExampleGet the index of the currently displayed tab page in the Tab1 component in an FVS template and display a pop-up message.

    You can download the example template. Get the index of the current page of the Tab component.fvs

    Tab接口-1.gif

    Mobile Terminal

    It is supported on mobile terminals.

    showCardByIndex 

    Method
    showCardByIndex(index)

    Display the n-th tab page in the Tab component.

    Parameterindex: numberThe index of the displayed tab page, starting from 0.
    Returned Value--
    Example

    Example One: Display the 2nd tab page (with an index of 1) of the Tab1 component in an FVS template.

    duchamp.getWidgetByName('Tab1').showCardByIndex(1)

    Example Two: Enable automatic carousel for the Tab component by clicking the title component, with an interval of 3 seconds.

    setInterval(function(){   
        var aa =duchamp.getWidgetByName("Tab1_Page1").getShowIndex(); 
        if(aa==2){ 
          duchamp.getWidgetByName('Tab1_Page1').showCardByIndex(0); 
        }
        else { 
          duchamp.getWidgetByName('Tab1_Page1').showCardByIndex(aa+1); 
        } 
    },3000);

    Example Three: Use a drop-down box widget to switch between tab pages.

    var a = duchamp.getWidgetByName("index").getValue(); 
    //Get the actual value of the drop-down box widget (in a string format).
    duchamp.getWidgetByName("Tab1_Page1").showCardByIndex(+a); 
    //Display the a-th tab page of a Tab component
    //where the plus sign (+) is used to convert the returned value to a numeric format.
    Application Example

    Change the displayed tab pages in the Tab1 component in an FVS template through a title component.

    You can download the example template.Use JS to switch between Tab pages.fvs

    Tab接口-2.gif

    Mobile Terminal

    It is supported on mobile terminals.

    setTabVisible 

    Method
    setTabVisible(name, visibility)

    Show/Hide a tab page.

    Parameter

    name: string

    visibility: boolean

    The index of the displayed tab page, starting from 0.
    Returned Value-

    string: tab page name (string)

    visibility: whether the tab page is displayed (boolean data type)

    • true: show

    • false: hide

    Example

    Example: Hide the Tab1 tab page of the Tab1_Page1 component in an FVS template.

    duchamp.getWidgetByName(
    'Tab1_Page1'
    ).setTabVisible(
    "Tab1"
    ,
    false
    );
    Application Example

    Customize buttons to hide/show the Tab1 tab page of the Tab1_Page1 component.

    You can download the example template.Use JS to show:hide Tab pages.fvs

    Tab接口-3.gif

    Mobile Terminal

    It is supported on mobile terminals.



    Attachment List


    Theme: Secondary Development
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback