Author Topic: How to auto adjust column width  (Read 1540 times)

nzxgq0

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 25
    • View Profile
How to auto adjust column width
« on: October 29, 2020, 01:25:24 pm »
Hello,

I have a grid which allows user to select the columns to display. Two issues:

1. Is there a way to automatically adjust the grid's column width based on user's selection?

2. How to set the font size or the row height on the selection dialog?

Thanks,
NZXGQ0

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: How to auto adjust column width
« Reply #1 on: October 29, 2020, 10:30:32 pm »
1. I'm not sure what  you mean by "automatically adjust the grid's column width based on user's selection".

There is API method flex() to automatically adjust the grid column width according to its contents. You can all this method from any event you want.

https://paramquery.com/pro/api#method-flex

2. Selection dialog view is based on pqgrid, so all the pqgrid options are also applicable to it.

Please use menuUI.gridOptions option to pass pqgrid options to it.

https://paramquery.com/pro/api#option-menuUI

e.g., to increase the row height:

Code: [Select]
menuUI: {
  gridOptions: {
    rowHt: 30
  }
}