Page 1 of 1

Display grid row details on panel

Posted: Thu Mar 15, 2012 9:50 am
by jholsombach
One of the designs i am attempting is to have a screen with a grid on the top half, and a panel on the bottom half. The idea is when you select a row on the grid, it will then display all the details for that record in the panel below.

So for instance, my grid might show ID#, name, effective date. Clicking on a row would then display below ID#, name, effective date, address, # of employees, etc etc.

Is there a way to do this without going back to the server, like hiding all of the necessary fields in the grid and then enabling the widgets below to set their values and turn on their visibility indicator?

Or do i have to return control back to the server to populate all of my widgets on the panel and then turn on my visibility indicator?

Re: Display grid row details on panel

Posted: Thu Mar 15, 2012 10:03 am
by Brian
Yes it is possible to hide data in your grid to be used elsewhere. You could then write a javascript function for onrowclick to load all of your widgets on your panel.

however, I would be wary of putting too much hidden data in the grid. When you start adding large amounts of data to each row of a lengthy grid, the extra time to send the grid data across the wire could be longer than a return trip to RPG to load the data for a single record.

Re: Display grid row details on panel

Posted: Thu Mar 15, 2012 10:29 am
by jholsombach
I also have all of my widgets (text output areas/text boxes, labels) conditioned on a bound indicator for visibility (to hide all of the fields when no row is selected).

Can the visibility be altered (turn on indicator 1st of course) without reexecuting the screen format?

Re: Display grid row details on panel

Posted: Thu Mar 15, 2012 10:41 am
by Brian
you can hide or unhide widgets using the following:

ID.style.visibility = "hidden";

ID.style.visibility = "visible";


ID of course being the ID of the widget in question.

Re: Display grid row details on panel

Posted: Thu Mar 15, 2012 10:44 am
by Brian
Correction:

getObj(ID).style.visibility = "hidden";

or

getObj(ID).style.visibility = "visible";

My mistake.