That was my initial thought. But after tinkering for a while, I think the best solution would be to bind the max width of the child based on the viewport width. Is there anyway to do this in weweb or with custom code?
I don’t think it’s a great idea (not a best practice), but if you want to go that way, then you can do it like this. Bind Plug on Max-Width → String “50vw”
For others, I found a workaround but it’s not perfect.
I created a global JS formula called “Return viewport width” with the formula → return window.innerWidth;
Then I did a bind on the max width of the element (a div in my case) with the “Return viewport width” formula. I subtracted padding (72px in my example) to determine the final width of the element.
The recommended solution is to rebuild the datagrid using a table. This should give you more control over the sizing, functionality, etc. I will test this route.
I think you’re overcomplicating it a little bit. You might want to spend some time and look into the settings, might find out the root of the problem. I’ve never had such problems with datagrids
Btw. you can get the same effect of a table with divs set to percentages of the parent. We did it like this on a project and it’s almost the same. If you see the underlining theory, css tables are just more strict divs with some fancy properties.
I understand your point and I’ve solved it when the table or datagrid is NOT in an expanded layout (accordion). Any idea how to do this when INSIDE an expanded layout (accordion)?
Horizontal scroll working when outside expanded layout
Set the expanded layout to a width of 100%.
Set the child within the expanded layout (like a datagrid) to a max-width of 100%.
Set the datagrid to scroll.