Page 1 of 1
hide a field
Posted: 2019-02-08 00:58
by wferreira
Good night!!!
How to hide a memo field from a group or user?
Att,
Washington Ferreira
Re: hide a field
Posted: 2019-02-08 07:56
by pbottcher
Hi,
can you please explain a little more detailed what you try to acheive. Do you want to hide the field in the TableView and/or in the DetailView?
Re: hide a field
Posted: 2019-02-08 11:40
by wferreira
the attached image is explaining
Re: hide a field
Posted: 2019-02-08 20:40
by pbottcher
Hi,
you can try this in the hooks/<tablename>.php file into the <tablename>_dv function the following:
Code: Select all
function <tablename>_dv($selectedID, $memberInfo, &$html, &$args){
if ($memberInfo['group'] == 'GROUPTOHIDE')
{
ob_start();
?>
<script>
$j('label[for="Observacao"]').parent().detach();
</script>
<?php
$new_layout = ob_get_contents();
ob_end_clean();
$html .= $new_layout;
}
}
Re: hide a field
Posted: 2019-04-29 12:24
by ronwill
Thanks PB, I was going to ask about this and appreciate you already having provided an answer in here.
Cheers,
Ron
Re: hide a field
Posted: 2019-07-03 16:48
by onoehring
Hi pbötcher,
I am curious. You suggested something similar (
viewtopic.php?f=2&t=3036 ) to a (from my point of view) similar question.
What is the difference between the code here (and why is this code not in the hooks/tablename _footer-function) and in my question?
I guess one could .hide the section as well.
I am happy about an explanation, but I understand if there are more important things for you. Thanks already anyway.
Olaf
Re: hide a field
Posted: 2019-07-03 21:15
by pbottcher
Hi Olaf,
there are multiple ways of getting to the (same) result, so you can choose which one you like most
.
Re: hide a field
Posted: 2019-07-04 04:07
by onoehring
Hi pbötcher,
thank you, and again I learned a little more about jquery - the .detach seems interesting.
Olaf