Show default filter form in Silverstripe ModelAdmin by default

I added ModelAdmin to my silver stripe website. This includes a filter shape that slides down when the user clicks on the magnifier icon in the interface. How can I make the form visible by default (without user interaction)?

So far I have tried to call showHide()from LeftAndMain.jsusing entwine, but since Silvertripe relies heavily on Ajax, it only displays the form on the page's bootstrap.

(function($) {
    $('#filters-button').entwine({
        onadd: function(){
            this._super();
            this.entwine('ss').showHide();
        }
    });
})(jQuery);
+4
source share
1 answer

By default, filters can be shown using CSS (replace .MyAdmin with the class name of your ModelAdmin):

/* file: mysite/css/admin-extensions.css */
.MyAdmin .cms-content-filters {
    display: block;
}

css :

LeftAndMain:
  extra_requirements_css:
    - 'mysite/cms/css/admin-extensions.css'

?flush, SilverStripe .

+3

Source: https://habr.com/ru/post/1650892/


All Articles