Page 1 of 1
Different language terms
Posted: Mon Feb 19, 2018 7:30 am
by JAW
Hello,
I have a project I which am using the Gridadd option on some tables. I have a number of Required fields but when I select Gridadd the red asterisk is not showing so the person entering the data has no way to know which fields are required, not all are. I added a red asterisk in the field name but on the List page when not in Gridadd it displays two red asterisks. I need to have this so it is displaying the red asterisk during Gridadd. Has anyone found a fix for this? It is possible to change the language term when entering Gridadd?
Regards,
JW
Re: Different language terms
Posted: Mon Feb 19, 2018 10:09 am
by mobhar
Simply enclose your code with if condition as follows:
if (CurrentPage()->CurrentAction == "gridadd") {
// your code goes below this line
}
Re: Different language terms
Posted: Mon Feb 19, 2018 11:09 am
by JAW
I had already tried to use the Language_Load Server Event without success. Here is what I tried;
if ($this->CurrentAction == "gridadd" OR $this->CurrentAction == "gridinsert") {
$this->setPhrase("Shift Type", "Shift Type <font color='#FF0000'>*</font>");
}
So using your suggestion I then changed it to the following;
if (CurrentPage()->CurrentAction == "gridadd" OR CurrentPage()->CurrentAction == "gridinsert") {
$this->setPhrase("Shift Type", "Shift Type <font color='#FF0000'>*</font>");
}
But neither of the above worked.
The Help file has the following;
$this->setPhrase("MyID", "MyValue"); // Refer to language file for the actual phrase id
So I looked in the Language File to find the "MyID" but all I can find for Shift Type is <phrase id="fldcaption" value="Shift Type" /> but that doesn't tell me an ID for Shift Type in the Language file.
Regards,
JW
Re: Different language terms
Posted: Mon Feb 19, 2018 6:21 pm
by JAW
Hi,
In Language_Load Server Event I tried to use just
$this->setPhrase("Shift Type", "Shift Type <font color='#FF0000'>*</font>");
So it would not be checking the CurrentAction or CurrentPage and it still does not work. It does not change the language of the field name.
Any other suggestions?
Regards,
JW
Re: Different language terms
Posted: Mon Feb 19, 2018 7:57 pm
by mobhar
Then inspect the element id/class, and use jQuery .html() to change the html code of the element by adding the red * character inside.
Re: Different language terms
Posted: Tue Feb 20, 2018 12:06 am
by JAW
In this case the Element Class is ewTableHeaderCaption but I don't want them all changed, only the ones that are required. I think I need to find a way to make the change on the language level not the class level. I am hoping there is an answer to this.
Regards,
JW
Re: Different language terms
Posted: Tue Feb 20, 2018 9:59 am
by mobhar
JAW wrote:
In this case the Element Class is ewTableHeaderCaption
No, it is not. If you are in GridAdd mode/page, then when you inspect the table column, each column has the difference class/id.
For example, when you are in GridAdd of "suppliers" table page, then the "CompanyName" table header column has its own id selector is "elh_suppliers_CompanyName", and its class name is "suppliers_CompanyName".
Re: Different language terms
Posted: Tue Feb 20, 2018 10:09 am
by Webmaster
JAW wrote:
$this->setPhrase("Shift Type", "Shift Type <font color='#FF0000'>*</font>");
That is wrong. There is no such phrase ID. To set field caption use: (assume your field name is "ShiftType")
$this->ShiftType->Caption = "Shift Type <span class='ewRequired'>*</span>"; // Also, avoid using out-dated <font> tag any more
Re: Different language terms
Posted: Sun Feb 25, 2018 11:38 pm
by JAW
Thank you, that worked exactly as I needed.
Regards,
JW