CSS Modify the Style of Prompt Box

  • Last update:December 16, 2020
  • I. Overview

    1.1 Requirement

    When data entry is made successfully, it’s better to have a message that says it successfully completed. However, if the message is too concise, the default tooltip size is too big to look good. Besides, the message is displayed in a single color. Therefore, you need to use CSS to set the size of the tooltip and the font color of the tooltip text.

    Specific effect is shown as below:

     

     

    1.2 Solution

    Add a Data Entry Successful event to the template and customize the size of the tooltip and the font color of the tooltip text.

    II. Steps

    2.1 Choose a template

    Open a data entry template. Here we take the template saved in the directory under %FR_HOME%\webapps\webroot\WEB-INF\reportlets\demo\Data Entry\Import Excel.cpt for example.


    2.2 Configure settings for a Data Entry Successful Event

    Click [Template]>[Web Attributes] >[Reference CSS]. Check [Individually set for the template] and add a Data Entry Successful event by inputting the following JavaScript codes:

     

    Input the following JavaScript codes:

    FR.Msg.alert("Prompt""Data Entry Successful!");
    $('#popup_title').css('color''black');
    $('#popup_title').css('font-size''17px');
    $('#popup_title').css('font-family''microsoft yahei');
    $('#popup_message').css('color''red');
    $('#popup_message').css('font-size''10px');
    $('#popup_message').css('font-family''microsoft yahei');
    $('#popup_container').css('min-width''100px');
    $('#popup_container').width(200);
    $('#popup_container').height(100);
    $('#popup_header').width(200);

     

    2.3 Hide the built-in tooltip

    If you want to hide the built-in Data Entry Successful tooltip, add a Loading End event:

     

    Input the following JavaScript codes:

    var old = FR.Msg.toast;FR.Msg.toast = function(x{
        if(x == "Success") {
            FR.Msg.alert("<font color=black size=3 face='microsoft yahei'>Prompt</font>",
     "<font color=red size=3 face='microsoft yahei'>Data Entry Successful!</font>");
            $('#popup_container').css('min-width''100px');
            $('#popup_container').width(100);
            $('#popup_container').height(100);
            $('#popup_header').width(100);
        } else {
            old(x);
        }
    }


    2.4 Preview

     

    III. Download the template

    Attachment List


    Theme: Secondary Development
    • Helpful
    • Not helpful
    • Only read

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

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

    不再提示

    9s后關閉

    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