Data Grid 2 Virtual scrolling dynamic size - Mendix Forum

Data Grid 2 Virtual scrolling dynamic size

21

Currently, while using the feature "virtual scrolling" in data grid 2, it is necessary to provide the number of rows which are displayed in the datagrid 2.

 

Instead it would be nice that datagrid 2 would just use a certain space and fit the rows inside. 

 

I. e. I would like to build a page there the data grid 2 with virtual scrolling is the main element. The page is fixed, i. e. non-scrollable, header and footer are always visible and the datagrid2 should use the remaining space inside. While the mouse pointer is hovered over the datagrid, scrolling should happening inside the datagrid.

 

This should be possible on multiple different screen sizes and touch devices as well. Touch devices often are hardly usable if multiple scrollable areas exists on an website.

 

Currently I found no way to implemented it as above, but if you have any suggestions, I'm open to try that. 

asked
3 answers

Hi David,

 

If you are looking to scroll only inside the datagrid without expanding the datagrid, you can try custom styling the datagrid by limiting the height of its content so that the full datagrid will be shown in your page with the header and the footer and the scrolling only happens within its content.You can try with the below styles in your stylesheet:

.custom-grid .widget-datagrid-content {

    max-height: 60vh !important;

}

 

Add the custom-class ".custom-grid" to your datagrid and the desired height value accordingly.

 

Thanks.

Created

having a Data Grid 2 that can just fit the available height would make our app's and pages much better.

I have been playing with a workaround to have options to show data grid 2's with a different number of rows and you can do some helper logic, but this is not what I would expect from Low code, to copy datagrid2 as many times as you need different number of rows. But it is a very creative workaround, worth mentioning here:

https://community.mendix.com/link/space/ui-&-front-end/questions/122198

 

Please get us DataGrid2 sizing the number of rows to the available height!

Created

Seriously +1 on this... Seems like such a basic feature that I cannot figure out how to implement, my page looks really ugly with 2 scroll bars and I hate the idea of paging so want the virtual scroll

Created