hiding an html image in a grid row following a condition

Hi,

I have a grid with a html image field and I need to show or mask that html image depending on a certain condition in the sql result.
If a field =2, mask the html image
if the field = 1, show the html image
I dont want to hide the complete column but just that element on specific row

how can I proceed I<ve tried this onrecord event but it do nothing

if({etat}==2){
sc_field_display({imprimer}, off)
}else{
sc_field_display({imprimer}, on)
}

Thanks

Hello,
I think in the onrecord event sc_field_display is not allowed !!!

Try the following
if … == 2 {imprimer} = “”;

Best regards
Uwe

Hello,

As Uwe said, sc_field_display doesn’t work in a way to display/hide record by record.

You can either hide the entire column, or display it.

regards,
Bernhard Bernsmann

Hi Bernhard,

Is it possible to hide just one html image button on one row and not the entire column?

Hi,

The if … == 2 {imprimer} = “”; is not working but I’ve found that using sc_link gave me the possibility to change the link in the onrecord event depending on the value of a variable.

It also gave me the opportunity to pass parameter to the link.

Now the problem I have is how to get these parameters value in the open link. For exemple one of the parameter is the value that must be “selected” in a select field.
How can I find the parameter values and pass them to the select as the “selected” element of the list

Hello,

I couldn’t understand the current problem very well. Is it a field value that you are trying to pass as a parameter? If your logic is onRecord(), then you can simply use {myField}.

If that was not what you asked, could you elaborate?

regards,
Bernhard Bernsmann

In a grid I’ve used sc_link in an html image to have different apps called when the user click on different html image in one column. For example
sc_link({imprimer},print,ficheno={ficheno}; fichier={fichier}; copie={copie}; printer={print},“Print that form”,“modal”,200,320);

I need to retreive the parameters fichier, copie, printer and ficheno in the print application which is a control apps

In raw php we do <a href=print.php?ficheno=$ficheno&fichier=$fichier&copie=$copie&printer=$print>Print that form</a>
and in print.php we retreive the parameters with ficheno=$_REQUEST[‘ficheno’]…

sc_link is used in the onrecord event and in print I don<t know exactly where to retreive these parameters. Onscriptinit, Onload, or ???

Hello Claude,

Please get in touch with our support regarding this issue. Our chat is active on workdays from 8:00am to 6:00pm, and our ticket system is always available.

regards,
Bernhard Bernsmann

Thank you but I’ve found how to retreive the parameters.

in my print app (control app), I just have to add {Imprimante} = [printer]; in onload event. sc_link create global variable with the parameters

Thank you

Hello Claude,

I’m glad you were able to solve the issue. Thanks for the feedback.

Bernhard Bernsmann