Change the Size of a List Collector Slushbucket Variable

alhicks
Tera Guru

I've tried the Catalog Client Script from the svc now guru website and it doesn't seem to work for me. All I changed was my variable name in the script below and the size of the list collector did not change any. Any ideas what would cause this Catalog Client Script NOT to work for me.

http://www.servicenowguru.com/scripting/client-scripts-scripting/change-size-list-collector-slushbuc...

function onLoad(){
var varName = 'YOUR_VARIABLE_NAME_HERE';
var height = '10'; //Optional
var width = '250'; //Optional
//Get the left and right bucket input elements
var leftBucket = gel(varName + '_select_0');
var rightBucket = gel(varName + '_select_1');
if(height && g_form.getControl(varName)){
//Adjust the bucket length (default is 18)
leftBucket.size = height;
rightBucket.size = height;
}
if(width && g_form.getControl(varName)){
//Adjust the bucket width (default is 340)
leftBucket.style.width = width;
rightBucket.style.width = width;
}
}

27 REPLIES 27

Mark Stanger
Giga Sage

It seems to work just fine on the demo instance right now. I just added it to the 'iphone 4' catalog item with a variable named 'users'. You can check that out and compare. Other things you can check are the name of your variable and any other client scripts or UI policies that might be causing a script error. If you PM me your instance name and catalog item name I can take a look.


Thank you so much, Mark. I'll take a look at DEMO.


Check it out in your system now. You'll always want to make sure to disable the syntax highlighter when you're pasting code into a script field. I suspect that's what caused the problem. The script is good, but some extra HTML garbage was pasted in without you knowing because the syntax highlighter was turned on.


Wow, that's good to know. Thank you so much, looks great.