Subfile grid resizing columns

Use this board to ask questions or have discussions with other Rich Displays users.
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Subfile grid resizing columns

Post 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");
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Subfile grid resizing columns

Post 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.
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Subfile grid resizing columns

Post by Paul_Ramcharitar »

Thanks a lot Alex. The workaround did the trick
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Subfile grid resizing columns

Post 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.
Antonio
Profound User
Posts: 82
Joined: Fri Jun 29, 2012 2:33 pm
First Name: Antonio
Last Name: Ruballos
Company Name: Profound Logic
Contact:

Re: Subfile grid resizing columns

Post by Antonio »

Hello Paul,

May I ask what browser you are currently using?
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Subfile grid resizing columns

Post by Paul_Ramcharitar »

Hi Antonio, I'm running in it Phonegap. The device is a Thinkpad tablet, with Android 3.0
Antonio
Profound User
Posts: 82
Joined: Fri Jun 29, 2012 2:33 pm
First Name: Antonio
Last Name: Ruballos
Company Name: Profound Logic
Contact:

Re: Subfile grid resizing columns

Post 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.
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Subfile grid resizing columns

Post 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.
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Subfile grid resizing columns

Post 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.
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Subfile grid resizing columns

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest