General Category > Help for ParamQuery Pro

Horizontal scroll bar scrollModel issue

(1/1)

jplevene:
colModel: {
   ...
   colModel : [
      {dataIndx:"ID", minWidth:"60", maxWidth:80},
      {dataIndx:"TITLE", minWidth:"200"},
      {dataIndx:"ALT_TITLE", minWidth:"200"},
      {dataIndx:"LOCATION", minWidth:"200"},
      {dataIndx:"DESCRIPTION", minWidth:"200},
      {dataIndx:"PART_NUMBER", minWidth:"100"},
      {dataIndx:"LAST_UPDATE", minWidth:"100"}
   ],
   scrollModel:{autoFit:true},
   flex: {on:true, all:false, one:false},
   width: "100%",
   height: "100%",
   ...
}

The issue is that minWidth is set and when the table is lets say 500 wide, I can sometimes scroll to the column by clicking on it if it is partially shown, but I don't have a horizontal scroll bar to scroll to it.

The idea is that I fill the grid width as it resizes, but the minWidth can cause the internal width to be more than the table width and I need a horizontal scroll bar.  How do I do that or is it a feature request?

paramvir:
That's not supported currently, can be added to feature request.

jplevene:
Just to help others, I accomplished this by doing the following:


--- Code: ---new ResizeObserver(function(){ grid_resize(); }).observe( grid );

grid_resize()
{
if(grid && grid.is(":visible"))
{
// Do we add horizontal scroll
var width = 0;
grid.pqGrid("Columns").each(function(col){
if(!col.hidden)
width += intval(col["width"]);
});

// Do we hide or show the scroll bar
grid.pqGrid("option", "scrollModel", {autoFit:width<grid.width() ? true : false});
}
}
--- End code ---

Navigation

[0] Message Index

Go to full version