In an application I am working on different clients want different views, depending on the context. For example: client A is a sonographer and wants all ultrasound data on top, client B is an obstetrician and wants all obstetric data on top.
I first thought of a per-user preference which is stored in the database. Unfortunately, I did not have a per-user store mechanism yet, so I would have to develop it. Because I am lazy, this triggered a though: this isn't actually a per-user setting, but a per-role setting. There are clients that are both obstetricians and sonographers. They would want the data ordered differently depending on the role they have at that time.
So I decided to solve this in a very simple way, which the user is going to like. I created a button in the view that only switches view properties when clicked. No server-side code involved. It sets a persistent cookie on the client with the last state. The next time the user visits the particular part of the application, the last state is restored.
No comments:
Post a Comment