I have a jqgrid and I have a custom formatter for it which formats and displays links as per my needs. This does work fine but I have a problem. I want to display links conditionally. How can I do that?
For Eg. If the person is Admin then show him all links like edit, delete etc (these links map to action methods in controller). But if the person is NonAdmin user then only show View link and hide all other links.
I just need a general strategy of how to accomplish this. One of the strategy would be I add a boolean field to my json data which would signify whether the link of edit, delete etc is to be shown or not. Then in my formatter and I can look at the row data and decide whether to return show link or not.
Is there any better way of doing this?