Author Topic: about column width  (Read 2344 times)

徐雪峰

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 48
    • View Profile
about column width
« on: October 10, 2020, 07:08:53 am »
is there any way to set the column width to fit the max length value auto?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: about column width
« Reply #1 on: October 12, 2020, 07:02:16 am »
I assume you want columns to fill up all the space in the grid.

Have you tried scrollModel: { autoFit: true }

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

徐雪峰

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: about column width
« Reply #2 on: October 13, 2020, 03:54:53 pm »
no ,for example,i hope when a value is 100,the column width is 15px,when then value is 10000,the column width is 25px.
is there any way?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: about column width
« Reply #3 on: October 13, 2020, 09:01:18 pm »
15/100 = 0.15
25/10000 = 0.0025

I don't see any way to set it up.

徐雪峰

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: about column width
« Reply #4 on: October 15, 2020, 07:52:51 am »
sorry, maybe i don't say it clear.
i want the column width to fit the the length of the column value.
for example , when "AA", the column width is fit to "AA",when "AAA",the column width is fit to "AAA".
but it is not nessary to fit the view. the width of grid can longer than the view.
i just want every column width fit it's value length.
is there any way to do it?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: about column width
« Reply #5 on: October 19, 2020, 12:16:32 pm »
Please check this example: https://paramquery.com/pro/demos/flex