JS sheet Switch Sheets via Radio Button Group Widgets

  • Last update:  2021-02-03
  • I. Overview

    1.1 Requirement

    In multi-sheet switch, users may feel difficult to select labels accurately, probably because there are too many sheet labels. Is there a simple way for users to select the exact sheets they wish to select?

    As shown below, by clicking an option in the Radio Button Group widget, you can switch to the corresponding sheet:


    1.2 Solution

    This can be achieved by adding an event to a Radio Button Group widget using JavaScript.

    II. Sample

    2.1 Steps

    1) Create a new workbook, generate 6 sheets, right-click on each sheet name, choose Rename and rename these sheets as apple, strawberry, orange, pear, blueberry and grape respectively.

    2) Add a template parameter “rs”. In the parameter interface, add a Radio Button Group widget, bind it to the parameter and set Data Dictionary, with values set to apple, strawberry, orange, pear, blueberry and grape respectively.

     

    Note

    Actual values of options in the Radio Button Group widget must correspond to sheet names on a one-to-one basis, or an error message will pop up. 

    3) Select the widget and add a Status Change event.

     

    Input the following JavaScript codes:

    var c = this.options.form.getWidgetByName("rs");var s = c.getValue();contentPane.loadSheetByName(s);

     

    2.2 Preview

    Save the template, preview the effect in the (Data Entry Preview/Data Analysis) mode, and click any value of the Radio Button Group widget to switch to the corresponding sheet. See the demonstration below:

    III. Download the template

    Attachment List


    Theme: Data Entry
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy