Set Readonly for a List Collector Catalog Variable?

ctu1
Giga Expert

Hi,

I can set Readonly for simple variables that originate from catalog requests in the resulting tasks by using a client script on the sc_task form with:


g_form.setReadonly('variables.my_variable',true);


This works fine with simple variables, e.g. when my_variable is of type "Single Line Text". However when it comes to a slushbucket type "List Collector", I am stuck.

How does one do that?
7 REPLIES 7

A523
Kilo Contributor

Have similar problem. Unfortunately the above solution disable the whole list collector and you cannot see the data. I have data that I have moved to the right bucket that I need to be visible but do not allow the user to change. Is there a way to remove just the Add and Remove option from the list collector.


A523
Kilo Contributor

I have this solution to remove all the arrow so that you cannot change the value or show back the arrow so that you can change the value.
function listCollectorHideArrow() {
var ve = $('variable_map').up('table');
ve.select('img[src*=arrow_lt]').each(function(img){img.up('table').hide();});
}

function listCollectorShowArrow() {
var ve = $('variable_map').up('table');
ve.select('img[src*=arrow_lt]').each(function(img){img.up('table').show();});
}


bpippert
Tera Guru

The solution posted by A523 disables the Arrows, but doesn't disable double-clicking to move items from one side of the slushbucket to the other. Our slight variation to account for this is:

function onLoad(){
var ve = $('variable_map').up('table');
ve.select('img[src*=arrow_lt]').each(function(img){img.up('table').hide();});
ve.select('.slushselectmtm').each(function(elmt){
elmt.ondblclick = function(){return false;};
});
}

We chose this solution over the one posted by ct because the one posted by ct hides the scroll bars in IE (although it works fine in Chrome and Firefox).