JS implementation click any position to display the drop-down box list

  • Last update:  2021-10-22
  • I. Overview

    By default, the drop-down box and the drop-down check box must be clicked on the right-most triangle to achieve the drop-down, which is not humanized enough. Most users prefer to click any position to expand the drop-down box option, and the specific effect is as follows:

    Before optimization:

    gif1.gif

    After the optimization:

    gif2.gif

    II. Solution

    Open %FR_HOME%\webapps\webroot\WEB-INF\reportlets\GettingStartedEN.cpt

    Switch to the parameter panel, select the drop-down box widget, and add the post-initialization event:

    1.jpg

    var self = this;
    $('input',this.element).click(function(){
        if(self.$view.css('display')=='none'){
            self.onTriggerClick();
        }
    });

    Note: In theory, you only need to add it in the widget's post-initialization event. If that doesn't work, try adding exactly the same code to the widget's pre-edit event.

    III. Download the template

    Attachment List


    Theme: Parameter
    Already the First
    • 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