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

Harish Murikina
Tera Guru

Hi Andrea,



                as per Ashik Narayan   suggestion use px for width . It works fine in Eureka. Without using px it was working fine in dublin


Hi All,



This code works fine for me....


function onLoad() {


  //g_form.loadingDialog.setDialog('loading');


  //g_form.loadingDialog.render();


  var cust = g_form.getValue('request_on_behalf_of');


  var leftBucket0 = gel('macro_module_select_0');


  var rightBucket0 = gel('macro_module_select_1');


  leftBucket0.options.length = 0;


  rightBucket0.options.length = 0;


  leftBucket0.size = 5;


  rightBucket0.size = 5;


  $j('HTML[data-doctype=true] .slushbucket .glide-list select').css('height', 'auto').css('overflow', 'scroll');


  $j('HTML[data-doctype=true] .m2m_filter_container').css('padding', '0');


  $j('select#macro_module_select_0').css('margin-top', '10px').css('overflow', 'scroll');


  $j('select#macro_module_select_1').css('margin-top', '10px').css('overflow', 'scroll');


  $j('.input-group-transparent span').css('left', '10px').css('top', '5px');


  $j('.slushbucket .col-xs-4:nth-child(1) ').css('width', '300px');


  $j('.slushbucket .col-xs-4:nth-child(2) ').css('width', '290px');


}


Adam43
Tera Contributor

how about a glide_list style list collector?  this would be only visible on the UI side, not the portal.  We have an ask to get more rows to show on the 'unlocked' glide_list style list collector.  I have an catalog client script running that works for the auto-unlock, and would love to include an expansion to the number of rows in it.....

my script:

//https://community.servicenow.com/community?id=community_question&sys_id=e7898d37dba31340fece0b55ca961962

function onLoad() {

var var1 = g_form.resolveNameMap('asset_tags');

setTimeout(function() {
$(var1 + '_unlock').click();
}, 750);
}