Topic
If there is a need to prevent users from right-clicking on editable list view rows, you can use jQuery to achieve this.
Instructions
- Add a Data Label control to your view. Make sure to enable the Literal property and disable the Prevent XSS property.
- Under the rule, "When the view executed initialize", add a Transfer Data action to the Data Label control.
- Map this script to the Data Label control under this action:
<script type="text/javascript"> $(document).ready(function() { $("tr").on("contextmenu",function(){ return false; }); }); </script>
- If users have the option to refresh the list view, then the script might stop functioning. To avoid this, you will need to add or edit, if existing, this rule: "When the View executed List refresh".
- Under this rule, add in the following actions, in order:
- Transfer data: pass an empty value to the Data Label control
- Transfer data: pass the same script above to the Data Label control
- Transfer data: pass an empty value to the Data Label control