[Data Grid] Full height grid

Forge Component
(36)
Published on 17 Mar (2 weeks ago) by OutSystems R&D
36 votes
Published on 17 Mar (2 weeks ago) by OutSystems R&D

Hi, Is there a way to set grid height to 100% or other relative value instead of pixel fixed?

Mykola (Nick) Tkachenko wrote:

Hi, Is there a way to set grid height to 100% or other relative value instead of pixel fixed?

+1 - I am new to Outsystems and was about to post this same question. I took a poke in the CSS, maybe there's something there, but I have a lot of learning to do still.


It is possible to do by changing height of the grid container after grid is loaded. 

I've done it in unload function of the grid.

Mykola (Nick) Tkachenko wrote:

It is possible to do by changing height of the grid container after grid is loaded. 

I've done it in unload function of the grid.

Thanks Mykola. Can you send a few snippets or a dummy project to explain? As mentioned I still have a lot to learn.


Hi, is anyone able to assist? I've done several failed experiments including setting trying to run javascript such as:

"document.getElementById('"+DataGrid.Id+"').GridHeight = window.innerHeight;"

or

"document.getElementById('"+DataGrid.Id+"').height = window.innerHeight;"


I have no idea if I'm headed in the right direction or not.

Thanks in advance!

  $('.wj-flexgrid').height(window.innerHeight);

Hi Nate,

try change height of the generated container.

That's the secret right there! Thanks.

I put this into a RunJavaScript action in the Web Screen Preperation:

"$('.wj-flexgrid').height(window.innerHeight-215);"


and I put this into the Web Screen Javascript property:

$( window ).resize(function() {
  $('.wj-flexgrid').height(window.innerHeight-215);
});


Works like a dream! I might figure out how to determine the fixed offset of 215 pixels automatically, but this suits my needs for now.