Jump to:

23355 Posts in 17838 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » ModelAdmin search results limit

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1943 Views
  • micahsheets
    Avatar
    Community Member
    164 Posts

    ModelAdmin search results limit Link to this post

    When I do a search in ModelAdmin, the results are limited to 30 by default which is ok. The problem is that I cannot see all of the results because of a bug in the CSS. The outer div does not surround all of the results but seems to cover up the lower ones. I am using SS 2.3.3.

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: ModelAdmin search results limit Link to this post

    Have you tried different browsers? How about tweaking it with Firebug and/or greasemonkey until the fix is applied? You did log/search the open tickets on this, correct?

    http://open.silverstripe.org

  • BLU42 Media
    Avatar
    Community Member
    71 Posts

    Re: ModelAdmin search results limit Link to this post

    I ran into the same issue. Apparently this is being changed in 2.4, so you can regard this as a temp patch.

    There is a fitToParent javascript call that helps keep everything looking nice but applying overflow:hidden to holder objects. It doesn't apply this if overflow:auto is specifically set, though.... In the case of ModelAdminPanel, this is not set which is keeping the scrollbar from appearing. This fix worked for me and my clients:

    First, apply the following code to your init() function in your ModelAdmin class:

    function init() {
       parent::init();
       Requirements::customCSS("
          #right #ModelAdminPanel{overflow:auto !important;}
          body.ModelAdmin #right{overflow: auto !important;}
       ");

    Next, you'll need to mod the LeftAndMain.js file. At line 160, comment out the fitToParent function:

    //   fitToParent('ModelAdminPanel',-60);

    Let us know how it works out for you!

    -John

  • potion_maker
    Avatar
    Community Member
    36 Posts

    Re: ModelAdmin search results limit Link to this post

    Thanks SmartPlugs. Good fix.

  • CodeGuerrilla
    Avatar
    Community Member
    105 Posts

    Re: ModelAdmin search results limit Link to this post

    An easier fix is to just add the following to one of your custom css files or as above:

    ProductAdmin.js

    $('#ModelAdminPanel').css('overflow', 'auto');

    Personally if I am hacking I like to still leave the core files alone.

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: ModelAdmin search results limit Link to this post

    Hi guys,

    Place this in your extended ModelAdmin class...

    static $page_length = 10;

    ...it will limit the results

    1943 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.