Listview Fixed header and enable horizontal & vertical scroll bar when data grows

  • 31 August 2019
  • 3 replies
  • 321 views

How to enable Listview Fixed header and enable horizontal & vertical scroll bar when data grows


3 replies

Hi  @vraj;


 


Have you seen this post(https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/Introduce-scroll-bar-in-view/td-p/89411)? inject js code as an expession on data label.


...and(https://www.datalytyx.com/how-to-add-a-scroll-bar-with-fixed-headers-to-a-k2-smartforms-list-view/)


 


https://briank2com.wordpress.com/2016/12/19/list-view-scrollbars/


Hope it helps...


 


Regards;


Widson.

Userlevel 5
Badge +16

Hi vraj,


 


I use this script to add a scroll to a list view in a form which makes the header fixed


<script>
$("[name ='Form11 Area Item1']").find('div.scroll-wrapper').css({"height":"100px"});
</script>

Change the name property in the script to the list view name.


Add the script to a data label and check Literal property and uncheck PreventXSS


 


 

Hi

 

Try this

<script type="text/javascript">

$( document ).ready(function() {

 

$('.view:eq(0)').css({"overflow": "scroll","width":"2000px"});  

          });

          </script>

 

It worked for me, view:eq(0) zero sepresent which view you want to put a scroll view

 

Regards

ElvisJacob

Reply