ParamQuery grid support forum

General Category => Help for ParamQuery Grid (free version) => Topic started by: Walker on March 15, 2018, 09:27:08 am

Title: Change height of the grid at run time
Post by: Walker on March 15, 2018, 09:27:08 am
Hi everyone,

I'm evaluating ParamGrid and ParamGridPro, I would like to know if it's easy to change a grid size at run time (after the grid has been initialized and filled)

Note :
I'm using a "dynamic layout" where the user can change the width / height of "windows" with splitters, that is why I need to adapt the grid's size
Title: Re: Change height of the grid at run time
Post by: paramvir on March 15, 2018, 09:38:44 am
Easy way is to set grid size in %

Other way is to listen to resize event of splitters and refresh grid size.
Title: Re: Change height of the grid at run time
Post by: Walker on March 15, 2018, 11:00:14 am
Do you have a code example how to refresh the grid size (ex. in pixels)
Title: Re: Change height of the grid at run time
Post by: paramvir on March 15, 2018, 09:35:39 pm
Code: [Select]
$grid.pqGrid('option', 'height', '600px').pqGrid( 'refresh' );
Title: Re: Change height of the grid at run time
Post by: Walker on March 16, 2018, 01:27:34 am
Sorry but it doesn't seems to work
My Grid works, it's displayed correctly, but when I apply the code , the grid is emptied, all the rows disappear
I checked the height parameter, tested with a "direct" value (ex. "600px""), still the same problem
Title: Re: Change height of the grid at run time
Post by: paramvir on March 16, 2018, 05:40:04 pm
Sorry there can't be 'px' in the height option value.

Code: [Select]
$grid.pqGrid('option', 'height', 600).pqGrid( 'refresh' );
Title: Re: Change height of the grid at run time
Post by: Walker on March 17, 2018, 12:29:14 pm
Thanks, without the "px" it works perfectly  8)