Page 1 of 2

Subfile grid resizing columns

Posted: Wed Sep 19, 2012 9:46 am
by Paul_Ramcharitar
I'm trying to dynamically resize my subfile from it's initial set of widths. I used the methods below and the subfile did resize, but the css got messed up. The background of the rows go missing after it crosses the added width that i set.

getObj("Pre-Grid").grid.setProperty("width", 700);
getObj("Pre-Grid").grid.setProperty("column widths", "305,100,100,190,5");

Re: Subfile grid resizing columns

Posted: Wed Sep 26, 2012 6:30 pm
by Alex
Hi Paul,

Setting the "width" and "column widths" properties does not automatically cause re-rendering of the grid. We will be adding a special method to allow the grid to re-render in the next release. However, for now, as a workaround, just add the following line of code after setting the properties.

getObj("Pre-Grid").grid.setNumberOfRows(7);

Instead of 7, use the number of rows (including the header) that your grid actually has. I know there is no need to set the number of rows, but this will cause the grid to re-render, which is what you want.

I hope this helps.

Re: Subfile grid resizing columns

Posted: Thu Sep 27, 2012 9:24 am
by Paul_Ramcharitar
Thanks a lot Alex. The workaround did the trick

Re: Subfile grid resizing columns

Posted: Mon Oct 01, 2012 10:44 am
by Paul_Ramcharitar
Hi Alex, I have encountered a problem after using "setNumberOfRows".

I have this property, "onrowclick" set to "pui.click("viewLink." + row)". What this basically does is, go to another screen when a specific row in the subfile is clicked. ("viewLink." + row) is the ID of a link in the subfile row.

Now when I click on a row, it shows that a response is being sent, but it doesn't go to the next screen any more.

Re: Subfile grid resizing columns

Posted: Mon Oct 01, 2012 6:28 pm
by Antonio
Hello Paul,

May I ask what browser you are currently using?

Re: Subfile grid resizing columns

Posted: Tue Oct 02, 2012 8:16 am
by Paul_Ramcharitar
Hi Antonio, I'm running in it Phonegap. The device is a Thinkpad tablet, with Android 3.0

Re: Subfile grid resizing columns

Posted: Tue Oct 02, 2012 2:10 pm
by Antonio
Paul,

Could you send me the dds for the screens you are having issues with? And if its possible maybe the rpg code as well. I can begin debugging it then.

Re: Subfile grid resizing columns

Posted: Tue Oct 02, 2012 3:40 pm
by Paul_Ramcharitar
I wont be able to give you the code or dds, but I can give you the tutorial that I followed to achieve what I wanted.
http://www.profoundlogic.com/docs/displ ... ubfile+Row.

Everything was working until I used the "setNumberOfRows" method.

Re: Subfile grid resizing columns

Posted: Tue Oct 02, 2012 7:57 pm
by Alex
We just published a new version (4.1.2). The grids now have a new .render() method that you should use instead. See here: http://www.profoundlogic.com/docs/displ ... nder%28%29

I believe this will solve your problem.

Re: Subfile grid resizing columns

Posted: Wed Oct 10, 2012 4:27 pm
by Paul_Ramcharitar
Hi Alex,

The .render() method worked. Thanks!

However I had to use "getObj("Grid1").grid.render();" instead of "getObj("Grid1").render();" as stated in the documentation: http://www.profoundlogic.com/docs/displ ... nder%28%29