rrn from Grid

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
m400mail
New User
Posts: 13
Joined: Wed Nov 19, 2014 3:39 am
First Name: Michael
Last Name: Krautscheid
Company Name: asMika
Contact:

rrn from Grid

Post by m400mail »

Hello to all

if there a Javascript function to receive the RRN form a Grid .
I read the Grid with following code
RPG CODE
// 
handleRowClick(row);

function handleRowClick(row) {
  var value = getObj("Grid01").grid.getDataValue(row, "EMAILA0001");
  //alert(value);
 pui.set("hd_emailadresse", value); 
 pui.set("HD_Action", '2');
 
 pui.click("HD_BTDisplayData"); 
}
i changed my database wtih hidden button "HD_BTDisplayData" and the hidden key hd_emailadresse
Now i want to refresh the Gridline .

thanks for your help
Michael
DanD
Profound User
Posts: 42
Joined: Wed Jun 14, 2017 12:06 pm
First Name: Dan
Last Name: Devoe
Company Name: Boston Warehouse Trading
State / Province: Massachusetts
Zip / Postal Code: 02062
Country: United States
Contact:

Re: rrn from Grid

Post by DanD »

Now i want to refresh the Gridline .
At the end of the function, did you try
"Grid01".grid.render(); ?

Also at the beginning of the function you may want to add the line
var myGrid = getObj("Grid01");

and then use
myGrid.grid.render();

So your new function would look like (untested)

Code: Select all

// 
handleRowClick(row);

function handleRowClick(row) {
  var myGrid = getObj("Grid01");
  var value = myGrid.grid.getDataValue(row, "EMAILA0001");
  //alert(value);
 pui.set("hd_emailadresse", value); 
 pui.set("HD_Action", '2');
 myGrid.grid.render();

Hope this helps
m400mail
New User
Posts: 13
Joined: Wed Nov 19, 2014 3:39 am
First Name: Michael
Last Name: Krautscheid
Company Name: asMika
Contact:

Re: rrn from Grid

Post by m400mail »

Hi ,

thanks,

but with pui.click("HD_BTDisplayData") starts my RPG program and updates the database record.

now i want to refresh only this one record on the Grid .
DanD
Profound User
Posts: 42
Joined: Wed Jun 14, 2017 12:06 pm
First Name: Dan
Last Name: Devoe
Company Name: Boston Warehouse Trading
State / Province: Massachusetts
Zip / Postal Code: 02062
Country: United States
Contact:

Re: rrn from Grid

Post by DanD »

Are the fields defined as Output fields, or text box, text area, hyperlink, etc?

If output, when control gets passed back to the RPG program, the values set that are changed within the grid will revert back, as they are not passed back to the program. Try changing the field to a text box (or other input-capable field) with an attribute of read-only.
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: rrn from Grid

Post by Scott Klement »

Michael,

You have the 'row' variable in the JavaScript code that you posted. You should be able to put this into a hidden textbox the same way you're doing the email address and action values. Then, the RPG program can read that row number, and can do a CHAIN to that subfile row, change the fields, and UPDATE to update the row.

Is that what you are asking?
m400mail
New User
Posts: 13
Joined: Wed Nov 19, 2014 3:39 am
First Name: Michael
Last Name: Krautscheid
Company Name: asMika
Contact:

Re: rrn from Grid

Post by m400mail »

Hello to all
and thank you for your input.

I did not know how to determine the row number
RPG CODE
pui.set("HD_SelectedRow", row);
This works fine.

thanks for your help
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests