[General] Setting Focus on a Mobile Text Widget Through JS

  • Last update:  2023-10-20
  • Overview

    Version

    Report Server Version

    App Version

    HTML5 Mobile Display Plugin Version

    11.0

    V11.0.68

    V11.0.68

    Application Scenarios

    If you need to fill in a report on mobile terminals, you may want to directly edit the report after the page is loaded, with the text widget automatically locating the cursor. This function is applicable to scenarios where shortcut keys for filling in reports are set.

    Functions

    Set the initialization code this.focusCode(); for a text widget to make it automatically locate the cursor and get the focus.

    Available Range

    1. Text widgets in the parameter panel of CPT and FRM templates

    2. Text widget in the filling report cells of CPT templates

    3. Text widgets in the body of FRM templates

    Example

    Designing a Template

    Create a CPT template. Choose Template > Mobile Attribute, tick Set as Mobile Canvas Size, and click OK. Design the template and add text widgets, as shown in the following figure.

    Set the database to which the report is submitted. Choose Template > Report Filling Attribute from the menu bar to set the report filling attributes.

    Adding an Event

    Create an event to allow the text widget to automatically locate the cursor. Add an After Initialization event with the code this.focusCode(); for cell A2.

    Demonstration

    After completion, the filling template preview effect on mobile terminals is shown in the following figure.

    Template Completed

    Attachment List


    Theme: Fine Mobile
    • 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