Re-sizing a reference variable width in the item and/or task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2015 01:52 PM
Hello,
I found an article on how to re-size a reference variable in the catalog item. Here is the link https://community.servicenow.com/thread/177647
Here is the code used
var myVar = $('sys_display.' + g_form.getControl('<variable name>').id); //Get the correct reference element
myVar.style.width = '350px'; //Set the width
It works well in the catalog item but it does not work in the item or task. I tried to change the name and tried a few other options that I found
g_form.getControl('variables.name').style.width = '350px';
for (var i = 0; i < g_sc_form.nameMap.length; i++) {
if (g_sc_form.nameMap[i].prettyName == '<variable name>') {
g_form.getControl(g_sc_form.nameMap[i].realName).style.width = '350px';
}
}
So far, no luck.
Any of you have some other ideas to get it to work in the item and task as well.
Thanks...Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2016 11:08 AM
Hi Johnny,
For variables on Requested Items you can use:
`g_sc_form.getDisplayBox(variable_name).style.width = '350px';`
For task variables you can do this by defining a field style like:
'width: 350px !important;'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2016 11:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2016 12:21 PM
I'm on Fuji Patch 10.
I create a new catalog item to rule out any other scripts I may have running, but still not working. I also disabled all other UI policies and client scripts from the Request Item as well to rule out anything interfering with this catalog client script.
Here is my catalog client script:
It works on the catalog item:
Doesn't work on the request item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2016 12:47 PM
if you bring up developer tools in your browser do you see any client errors?
If you need help, I can jump on a quick websession to fix the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2016 01:01 PM