Grid, Expand to Layout column sizing

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
jwurst
Profound User
Posts: 20
Joined: Wed Aug 22, 2012 11:30 am
First Name: Jeff
Last Name: Wurst
Company Name: BBCS
State / Province: Washington
Country: United States
Contact:

Grid, Expand to Layout column sizing

Post by jwurst »

Is there any way to design a subfile grid so that when expands horizontally then only the right most column expands while the others remain fixed size?

I have my grid in a simple layout set to 100% width. When I expand the browser window then all of the columns resize proportionally but I only want the one column to grow. I tried using javascript to dynamically reset all of the column widths based on the with of the window or layout but it has no effect. Maybe I just don't know how to change a property that is an array?

In screen load:

Code: Select all

function setSFLSize() {
  var puiw = document.getElementById("pui").offsetWidth;
  var calcColWidth= puiw-917;
  applyProperty('MyGridName','column widths', '22,27,141,54,97,55,53,54,54,53,54,55,39,38,42,42,' + calcColWidth);
}
setSFLSize();
window.onresize = function () {
  setSFLSize();
}
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Grid, Expand to Layout column sizing

Post by Scott Klement »

If you're using the "expand to layout" option, it will automatically adjust all of the column widths proportionately to the change in the parent layout size. This is the only feature we have for allowing the grid widget to change in size.

What most customers do is create a grid with only one column, and let that expand to the layout. They will put multiple widgets inside the single column -- so the application can show lots of different things in the grid (not just one field) but since there's only one column in the grid, it resizes nicely.

I suppose you could try to write your own code to resize the columns instead of using the "expand to layout" capability. This is something I have not tried to do -- so I cannot tell you how well it works. Your code looks like what I would try -- except that after changing the column widths property, you'll also have to force it to re-render (i.e. draw) the grid. We provide a grid.render() API that may work, but again, I haven't tried it.
jwurst
Profound User
Posts: 20
Joined: Wed Aug 22, 2012 11:30 am
First Name: Jeff
Last Name: Wurst
Company Name: BBCS
State / Province: Washington
Country: United States
Contact:

Re: Grid, Expand to Layout column sizing

Post by jwurst »

Thanks for the response. On my attempts, including using grid.render(), I got the grid to partially expand. Some of the displayed elements moved and some didn't so it didn't really work. Using a single column is a good idea and will probably work most of the time.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests