This topic is locked

Change Labels Based on Active Tab

8/14/2020 12:29:21 PM
ASPRunner.NET General questions
I
i.NoLim author

Is there any way to control the Label of a field based on the active tab? I found in the manual the setFieldLabel method but this can only be used in the AfterAppInit, AfterTableInit, or BeforeProcess events. How do I pass the value I got from the Javascript onload event?
The reason why I would like to do this is because I currently have 3 columns (dateUpdated, dateClosed, dateDeleted) that I would like to combine into one, dateUpdated, but I would still like the label to appear as 'Date Updated' 'Date Closed' and 'Date Deleted' in their respective tabs.

admin 8/18/2020

What is the 'active tab'?

I
i.NoLim author 8/18/2020

'Active tab' is the currently selected tab.
Note: This is for "Additional WHERE tabs" not tabs created in Designer.

admin 8/18/2020

When you change the tab, the current tab name is reflected in the URL. So you can use one of the events to read the current tab name from the URL and apply your logic based on that.

I
i.NoLim author 8/25/2020



When you change the tab, the current tab name is reflected in the URL. So you can use one of the events to read the current tab name from the URL and apply your logic based on that.



I know how to get the tab number and I understand the logic, I just don't know what's the syntax for changing the label.



var activetab = $("li[class=active]").find("a").attr("data-tabid")
if (activetab == 0){

updateLabel = "Date Updated";

}

else if (activetab == 1){

updateLabel = "Date Closed";

}

else{

updateLabel = "Date Deleted";

}