Skip to main content


 

Symptoms

 


Very long list views where pagination is undesired.
 

 

Diagnoses

 


Not possible out-of-the-box, but can be done with some JavaScript.
 

 

Resolution

Add a hidden, literal, enabled Data Label with the code below in an expression on the label on the outer form. To enable shrinking for specific views, just add a Data Label with no code named 'shrinkMe'. The jQuery will search for all elements named 'shrinkMe' and attempt to shrink all of them and add scroll bars.

<script>
  $(document).ready( function(){
    $.each($('spananame=shrinkMe]'), function (index, element) {
      var scrollWrapper = $(element).closest('.runtime-content').find('.scroll-wrapper');
      scrollWrapper.height('auto');
      scrollWrapper.css('max-height','200px');
      scrollWrapper.css('overflow', 'scroll');
      scrollWrapper.css('overflow-x', 'hidden');
    });
  });
</script>

 

 



 

Hi Jonathan,

I have the same requirement. I have a form with tabs, and each tab holds multiple tables (views).

But, when I implement the way you told, it applies scrollbar onto the entire tab, including every views inside it.

 

What I did -

 - I put a datalabel onto one tab and added an expression onto it with the script,

 - I changed the identifier "shrinkMe" with the title of one of the views expecting it to address that view only

 

I am very new to JQuery, so if you please can help me


Reply