API Only for Date Widget

  • Last update:  2022-02-10
  • setMaxAndMinDat

    MethodsetMaxAndMinDate(Date)

    Set an optional date range for the date widget

      Parameter

    Date:

    {

        max: string | Date;

        min: string | Date;

    }

    Start date and end date, in json format

    • max: end date, supports string and date formats, the format is: yyyy-mm-dd HH:mm:ss

    • min: start date, support string and date format, the format is: yyyy-mm-dd HH:mm:ss

    Return valuevoid
        Example

    Example 1: If the obtained date widget object is defined as dateEditor, set the optional date range to 2021-09-01 to 2021-09-08

    dateEditor.setMaxAndMinDate({
        min: "2021-09-01",
        max: "2021-09-08"
    });

    Example 2: In a general report, set the optional range of the date widget dateEditor0 on the parameter pane to 2021-09-01 to 2021-09-08

    _g().getParameterContainer().getWidgetByName("dateEditor0").setMaxAndMinDate({
        min: "2021-09-01",
        max: "2021-09-08"
    });

    Example 3: In a general report, set the optional range of the date widget dateEditor0 in the data entry cell to 2021-09-01 to 2021-09-08

    _g().getWidgetByName("dateEditor0").setMaxAndMinDate({
        min: "2021-09-01",
        max: "2021-09-08"
    });

    Example 4: Dashboard, set the optional range of the date widget dateEditor0 on the body to 2021-09-01 to 2021-09-08

    _g().getWidgetByName("dateEditor0").setMaxAndMinDate({
        min: "2021-09-01",
        max: "2021-09-08"
    });

    Note: After adding an event, after an error is reported because the report block object is not completely created, you can add a delay function to delay execution, such as:

    setTimeout(function(){
    _g().getParameterContainer().getWidgetByName("dateEditor0").setMaxAndMinDate({
        min: "2021-09-01",
        max: "2021-09-08"
    });
    }, 500);

    Application

    example

    Set the optional range of the date widget dateEditor0 on the parameters pane to 2021-09-01 to 2021-09-08 :

    Click to download the template: 

    Date widget optional value range.cpt

    1.png

    MobileSupport mobile terminal

    setPopupStyle

    Method

    setPopupStyle(PopupStyle)

    Set the date widget popup style

      Parameter

    PopupStyle:

    {
        itemHeight: string;
        fontSize: string;
    }

    Popup style, json format

    • itemHeight: The height of the popup date option grid

    • fontSize: The font size of the options in the popup

    Return valuevoid
        Example

    Example 1: If the obtained drop-down box widget object is defined as widget, set its pop-up box date grid height to 10px and font size to 10px

    widget.setPopupStyle({
        itemHeight: "10px",
        fontSize: "10px"
    });

    Example 2: Get the date widget dateEditor0 on the parameter pane, and set its pop-up box date grid height to 10px and font size to 10px

    _g().getParameterContainer().getWidgetByName("dateEditor0").setPopupStyle({
        itemHeight: "10px",
        fontSize: "10px"
    });

    Example 3: Obtain the date widget dateEditor0 in the data entry cell in the general report, and set the date grid height of its pop-up box to 10px and the font size to 10px

    _g().getWidgetByName("dateEditor0").setPopupStyle({
        itemHeight: "10px",
        fontSize: "10px"
    });

    Example 4: Obtain the date widget dateEditor0 in the body in the dashboard, and set the date grid height of its pop-up box to 10px and font size to 10px

    _g().getWidgetByName("dateEditor0").setPopupStyle({
        itemHeight: "10px",
        fontSize: "10px"
    });

    Note: After adding an event, after an error is reported because the report block object is not completely created, you can add a delay function to delay execution, such as:

    setTimeout(function(){
    _g().getParameterContainer().getWidgetByName("dateEditor0").setPopupStyle({
        itemHeight: "10px",
        fontSize: "10px"
    });
    }, 500);

    Application

    example

    Modify the pop-up box date grid height of the date widget dateEditor0 to 10px and font size to 10px:

    Click to download the template: 

    Modify date widget style.cpt

    2.png

    MobileNot support mobile terminal


    Attachment List


    Theme: Secondary Development
    • 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