This topic is locked

Return Value on List Page

8/3/2022 11:53:11 PM
PHPRunner General questions
J
JoeB7774 author

Hello. On List page, JavaScript OnLoad, can I return the value of a field when clicking on the detail icon (the icon with the three dots and lines close to the left hand side of the record)? The value I want returned (CalcsToInclude) is in the record where I'm clicking the detail icon. I have tried various examples but can't get it to work. The following doesn't produce an error.... I just don't get an alert. I've verified that there is a value in the field. I've switched to swal("Hello") and I get that alert. Thanks in advance for any assistance.

$("[id^=details_]").bind("click", function(){

var ctrl = Runner.getControl(pageid, 'CalcsToInclude');
var calcVal = ctrl.getValue();
swal(calcVal);
});

Sergey Kornilov admin 8/4/2022

getControl() function is designed to provide an access to the Edit control, which means it will work on pages like Add, Edit and Register.

Do you need to access the field from the master record?

J
JoeB7774 author 8/5/2022

I need to return a value on the record here I click on the Detail icon. I have a master record, a detail on that master record (Detail 1), and then a detail on Detail 1 (Detail 2). When I click on the Detail icon on a Detail 1 record (to expand Detail 2 under that Detail 1 record), I would like to get a value (called CalcsToInclude) from Detail 1. I was experimenting with the information on hiding tabs (https://xlinesoft.com/blog/2020/05/09/hiding-details-table-tab-on-the-fly/) but can't seem to get the right code to get a value from Detail 1.