Hide table field to specific user

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
MatteoAllix
User
Posts: 117

Re: Hide table field to specific user

Post by MatteoAllix »

Hello,

is it possible to hide a field from a table to a typology of users only when you enter in the edit page?

My requirement is to remove the ability to add or modify the value of a field to a particular type of user (the administrator can do what he wants).
This particular field must be read only for normal user (i.e. in List Page and in View Page).

Thanks,
Matteo.


motfs
User
Posts: 258

Post by motfs »

Use FieldVisibility extension to hide the field. Read the notes to see how to use it after you click the extension


MatteoAllix
User
Posts: 117

Post by MatteoAllix »

Okay, it works.

but if I want that a field become "HIDDEN" only for a particular type of user?
Because Field Vsibility removes that field from the dataset, I need it to be written, but not visible to the user..

Thanks,
Matteo


motfs
User
Posts: 258

Post by motfs »

but if I want that a field become "HIDDEN" only for a particular type of user?

If the particular type of user is an User ID or an User Level, note that FieldVisibility extension supports User ID/Level also.

Alternativey, you can use Startup Script to hide/show the field with your condition (use jQuery .hide, read http://api.jquery.com/hide/), e.g.:

if (<your condition>) {
$("#x_<Field>").hide(); // Replace <Field> with actual Field Name, if not sure, view HTML source to check the element ID.
}

Read Server Events and Client Scripts -> Client Scripts -> Startup Scripts in help file for more detail.


MatteoAllix
User
Posts: 117

Post by MatteoAllix »

Alternativey, you can use Startup Script to hide/show the field with your condition
(use jQuery .hide, read http://api.jquery.com/hide/), e.g.:

if (<your condition>) {
$("#x_<Field>").hide(); // Replace <Field> with actual Field Name, if not sure,
view HTML source to check the element ID.
}

is it possible to get the user level here?
In C# I have CurrentUserLevel().


Post Reply