Successfully!

Error!

You are viewing 10.0 help doc. More details are displayed in the latest help doc

Date Widget Exclusive

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: 11.0 New Features
Already the First
Already the Last
  • Helpful
  • Not helpful
  • Only read

Doc Feedback