Hello
I am using AppGini 5.76
I have a Lookup field named "statut" in a table named "mauritanie". I want to make "statut" read-only for non admins users. I have try all post in the forum but still cannot do it.
Thanks for any help
Regards,
Make a Dropdown field read-only for non admin users
Re: Make a Dropdown field read-only for non admin users
Hi,
you may try this in the hooks/mauritanie.php file, add to the mauritanie_dv function:
Make sure the ending EOC; is at the beginning of the line (no spaces or tabs in that line)
you may try this in the hooks/mauritanie.php file, add to the mauritanie_dv function:
Code: Select all
$html .= <<<EOC
<script>
function waitForElementToDisplay(selector, time) {
if(document.querySelector(selector)!=null) {
\$j('#statut-container').select2('readonly',true);
return;
}
else {
setTimeout(function() {
waitForElementToDisplay(selector, time);
}, time);
}
}
waitForElementToDisplay('#s2id_statut-container', 1000);
</script>
EOC;
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Make a Dropdown field read-only for non admin users
Hello
Thank you for the help, going to try and back to you.
Regards,
Thank you for the help, going to try and back to you.
Regards,
Re: Make a Dropdown field read-only for non admin users
Hello
seems I miss something, not working for me
Thank you
seems I miss something, not working for me
Thank you