This topic is locked
[SOLVED]

 Hide Column (List) when not in a Security Group

3/8/2018 5:38:32 PM
ASPRunner.NET General questions
J
Jan K. van Dalen author

Ok, I'm pretty new to ASPRunner.Net. I did search the manual and the forums but can't figure how to accomplish the following:
Using 9.8 / Bootstrap / AD Authentication with Dynamic Permissions / List Page
Column is a recording (blob) and set to View as Audio ... this works great
I need to hide the column in a List Page if the user is not part of a group.
I tried using a hammer just to test if I could hide the column regardless and added:
pageObj.hideField("Media");
in the OnLoad event of the List Page but did not work.
Questions:

  • How can I hide a column?
  • How can I hide based on a security group?


Many thanks in advance
Jan K. van Dalen

jadachDevClub member 3/8/2018

Here is a snippet I just used to hide the value of a field on certain rows.
List page after record processed

if (data["Accepted"] == "1" && data["PracticeID"] != data["PracticeID1"]) {

record["Staff_value"] = false;

}


Staff_value is the Field Name_value
So in your case, you can use a session variable to identify the role, then use that session variable in your List page after record processed event

admin 3/9/2018

hideField() will work but you need to use a correct event:

https://xlinesoft.com/asprunnernet/docs/hidefield.htm

J
Jan K. van Dalen author 3/12/2018

Thank you Jerry ...



Here is a snippet I just used to hide the value of a field on certain rows.
List page after record processed

if (data["Accepted"] == "1" && data["PracticeID"] != data["PracticeID1"]) {

record["Staff_value"] = false;

}


Staff_value is the Field Name_value
So in your case, you can use a session variable to identify the role, then use that session variable in your List page after record processed event

J
Jan K. van Dalen author 3/12/2018

Thank you Sergey



hideField() will work but you need to use a correct event:

https://xlinesoft.com/asprunnernet/docs/hidefield.htm