I want to give my users the ability to set the columns on their list view. Some will want to display mail, while others will not. I was thinking about a table called listview in which every user adds the fields the he wants to display. Then I somehow select only those fields based on user from the list view. Any ideas?
Dynamic List View
-
- User
- Posts: 140
Use "ListOptions_Load" and "Row_Rendered" server event to hide the certain columns.
Can you add to this detailed logic so I can implement?
setup a table called setup_userlistview:
index
field
user
In the customer table I would query the setup_userliview table based on listoptions and render the list? Can you give example of the code line?
-
- User
- Posts: 1599
To hide a field in Row_Rendered server event:
if (CurrentPageID() == "list") // assume you want to hide in list page
$this->yourfield->Visible = FALSE;
To get the value from another table:
$value = ew_ExecuteScalar("SELECT yourfield FROM yourtable WHERE your condition"); // only one column will get
See Server event and Client script in help file. Also, you can set Visible property in Page_Load server event for your list page or view page.
You just create the table for user list of preference. Then, you can get the value to set Visible property:
$this->yourfield->Visible = $value; // if $value is greater than 0, it will be true.