How do I add a scroll bar in a custom dashlet?

I have a custom dashlet based on the model of the learning-resources dashlet.
However mine has a dynamic number of entries based on the contents of certain custom fields.

When rendering, the items listed sometimes extend beyond the dashlet limits and overlap any other dashlets following it.

How do I contain the list of elements and add a scroll bar?

thanks,
FrancescaS
Parents Reply
  • The dashlet structure is:

    <div class="dashboard" data-dashboard="true">
      ....buttons and headers
        
        <div data-dashlet="dashlet" class="dashlet-content">
          <ul class="dashlet-licenses">
           <li class="resource ">
               ..the list item
           </li>
                ...many more list items...
         </ul>
        </div>
        <div class="block-footer">
    ..etc


    The dashlet-content was spilling out of the dashlet...

    I added the css setting before calling the parent renderHtml:

    $('ul.dashlet-licenses').closest('.dashlet').css("overflow","scroll");
    self._super('_renderHtml');

    and it WORKED! :)

    Thank you!
    FrancescaS

Children
No Data