Page 2 of 2

Re: Grid Selection criteria from client side

Posted: Sat Jul 13, 2013 4:06 pm
by HowardA
Thanks Scott, binding directly to the field did show the data upon launch.
Now the next question is, I want to update the data in the grid based on a value on the screen (without returning to the RPG). I used this in an "onclick" event of a button to test:
getObj("selcovtrn"); changeElementValue("selcovtrn", "B"); alert(get("selcovtrn")); getObj("sflCovTrn").grid.refresh();
The alert was to see that I had the value from the field. When I execute this, it flashes the grid but doesn't update it with the new data (selection criteria changed).

Re: Grid Selection criteria from client side

Posted: Sun Jul 14, 2013 10:49 pm
by Scott Klement
Ahh, I see.. well, in that case, you probably don't want the field to be bound to the RPG field. Instead, you want to do something like this:

Code: Select all

applyProperty("sflCovTrn", "parameter value", "B");
applyProperty("sflCovTrn", "field type", "grid");
getObj("sflCovTrn").grid.refresh();
getObj("sflCovTrn").grid.render();
Or, if you want to get the 'B' from a screen field, you want to do this:

Code: Select all

applyProperty("sflCovTrn", "parameter value", get("selcovtrn"));
applyProperty("sflCovTrn", "field type", "grid");
getObj("sflCovTrn").grid.refresh();
getObj("sflCovTrn").grid.render();

Re: Grid Selection criteria from client side

Posted: Mon Jul 15, 2013 12:07 pm
by HowardA
Thanks!!!! I can't wait to try it out

Re: Grid Selection criteria from client side

Posted: Mon Jul 15, 2013 7:53 pm
by HowardA
Exactly what I was looking for! Works great, thanks Scott!