
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Variable Editors are a popular feature on the platform. They are typically used to display information gathered from the requestor or end user using service catalog forms (catalog items and record producers) to the fulfillers. In some cases, variable editors can be exposed to the requestors as well so they can review the information they had input while submitting the request.
While variable editors are editable by default, there are a number of instances where it may be necessary to use the variable editor for display purposes only. For example, to ensure the integrity of the information provided by the requestors, fulfillers may only need to view the data, not edit it. There are a number of custom solutions that are used today, most of which use DOM-manipulation to meet the need. Manipulating the DOM means that you, as the customer, now owns the customization and will have to maintain it through upgrades. Also, if the DOM gets modified in a new release, your existing capabilities may no longer function as expected. See Avoid DOM manipulation.
To address this need, I am adding a client script below that can be used to render the variable editors as read-only. In the future, we intend to introduce this within the platform so you won't have to.
Use a Client Script to render Variable Editors as read-only
The script below can be added for the Requested Item and Catalog Task tables or any task-extended table where record producers may be used. If you would like to change the behavior for individual catalog items, you can do so by extending the script to add conditions filtering out the specific items where you don't want this behavior.
ReadOnly Variable Editor (On Load client script)
function onLoad()
{
$("variable_map").querySelectorAll("item").forEach(function(item) {
var variable = item.getAttribute("qname");
g_form.setReadOnly("variables."+ variable, true);
});
}
We are constantly striving to provide more of these experiences within the platform, so if you have other areas where you need help, do reach out to us!!
- 5,167 Views
- « Previous
-
- 1
- 2
- Next »
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.