Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2023 08:04 AM
The removeOption method only works for Select Box type variables. What you need to do is update the filter on the List Collector, so your onChange Catalog Client Script would look more like this:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var parm = '';
if (window === null)
parm = 'portal';
else
parm = 'native';
var varName = 'select_appli_list';// name of the list collector variable
var filterString = '';
if (newValue.indexOf('choice 1') != -1) { //choice 1 is one of the selections
filterString = 'sys_idINchoice 1'; //new list filter will only contain 1 choice
}
if (newValue.indexOf('choice 2') != -1 || newValue.indexOf('choice 3') != -1) {
filterString = 'sys_idINchoice2, choice3';
}
//reset the filter (left side) based on the selection(s)
if(parm == 'portal'){
var myListCollector = g_list.get(varName);
myListCollector.reset();
myListCollector.setQuery(filterString);
} else {
window[varName + 'g_filter'].reset();
window[varName + 'g_filter'].setQuery(filterString);
window[varName + 'acRequest'](null);
}
}
Replacing 'choice 1' etc with the sys_id of the record.