JS Get all values of extended widget

  • Last update:  2020-12-15
  • I. Overview

    1.1 Problem

    When a data entry report is displayed, the reporting widget is extended. As shown in the figure below, we can get all the extended values of the radio button group widget:

    1.gif


    1.2 Solution

    Add a click event to the button to traverse the widget, if there is only one, get its value; if there are multiple, traverse to get all the values.

    II. Example

    2.1 Add a extended widget

    Create a new template, right-click cell C7 to add a radio button group widget, and set the widget name to p1:

    2.png

    Set the C7 cell to expand vertically:

    3.png

    Add a data dictionary to the radio button group: 

    4.png

    Right-click the cell D7, add a button widget, set the button type to be insert row, and specify the cell as C7:

    5.png


    2.2 Get extended widget value

    Add a button widget in cell C9, and add a click event:

    6.png

    JavaScript:

    var temp="";
    var arr=contentPane.getWidgetsByName("p1"); 
    if(arr[0]!=undefined)
    {
       for(var i=0;i<arr.length;i++)
       {temp = temp + arr[i].getValue() + ' ';}
    }
    else 
       {temp=arr.getValue()
    }
    alert(temp);


    2.3 Preview effect

    Save the template, click data entry preview , the effect is shown in the figure below:

    7.gif


    III. Download 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