Author Topic: Grid auto width scroll bars  (Read 1081 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Grid auto width scroll bars
« on: April 22, 2023, 12:54:05 am »
I have set the following options:

   stripeRows: true, // Show stripes
      menuIcon: false,
      scrollModel:{autoFit:true},
      flex: { on: true },
      showTitle: false, // Hide table title
      wrap: false, // Cell content on one line
      hwrap: false, // header content on one line
      showTop: false, // Hide top  (including col move icons)
      selectionModel: { type:"row", mode:"single", column:false, all:false}, // Select rows
      wrap: false,

I also have some columns with min and max width set.  The issue is that due to the min and max width, when the grid is not wide enough to fit all the columns, there is no horizontal scroll bar, instead the far right columns are clipped off screen.  I need the flexible auto width to the screen, and when that is not possible (minimum width due to column width constraints), the horizontal scroll bar should appear instead of clipping the grid.

Also, when the data is empty, as in dataModel: {data: []}, how do I remove/hide or disable the "undefined" message?
« Last Edit: April 22, 2023, 01:01:51 am by jplevene »

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Re: Grid auto width scroll bars
« Reply #1 on: April 22, 2023, 01:05:21 am »
Answering my own question regarding hiding the "undefined" for no rows, just set the following CSS:

Code: [Select]
.pq-grid-norows { display:none;}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Grid auto width scroll bars
« Reply #2 on: April 24, 2023, 01:17:42 pm »
1) It's not feasible.

2) undefined message would go away by including the localization file, it's a required file.

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Re: Grid auto width scroll bars
« Reply #3 on: May 18, 2023, 07:11:52 pm »
Thanks Paramvir,

Regarding point 1, is there any way to set some columns as fixed width, make the grid try and fill the full width, however if it is too wide due to the fixed width columns, enable horizontal scrolling?  Other grids like jqGrid get around this.

J

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Grid auto width scroll bars
« Reply #4 on: May 19, 2023, 02:09:18 pm »

camillari1

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • liqui-glide.com
Re: Grid auto width scroll bars
« Reply #5 on: April 18, 2024, 07:32:34 am »
I'm having the same problem.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Grid auto width scroll bars
« Reply #6 on: April 18, 2024, 01:07:41 pm »
Please use wdith: 'flex' along with maxWidth of the grid instead of scrollModel.autoFit: true