- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 10:17 AM
Hi All,
Can anyone please help us on the below requirement.
We developed one catalog with few variables.
In that one variable callled Company (Select Box type) with drop down options.
ANd another variable called Region (List collector type ---> Refer to Regions table ---> Region field {List field type}).
And now we want to display the Region choices in slush bucket based on the Company variable selection.
Can anyone please help us with sample script.
Note: Gone through few link in community but no luck.
Advance thanks for the support.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 07:52 AM
Hiii,
Below script working fine for us.
Many thanks to
Client script:
function onChange(control, oldValue, newValue, isLoading) {
var headers = g_form.getControl('u_region').parentElement.querySelectorAll('.col-xs-4');
var collectorName = 'u_region';
var filterString = '';
if(newValue == 'Australia'){
filterString = 'question.nameSTARTSWITHu_region^textNOT LIKEAustralia';
}
else if(newValue == 'Austria')
{
filterString = 'question.nameSTARTSWITHu_region^textNOT LIKEAustria';
}
setCollectorFilter();
function setCollectorFilter()
{
//If it hasn't rendered yet, wait 100ms and try again.
if(typeof(window[collectorName + 'g_filter']) == 'undefined')
{
setTimeout(setCollectorFilter, 50);
return;
}
//Reset the filter query
window[collectorName + 'g_filter'].reset();
window[collectorName + 'g_filter'].setQuery(filterString);
window[collectorName + 'acRequest'](null);
//Redisplay the list collector variable
//g_form.setDisplay(collectorName,true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 07:52 AM
Hiii,
Below script working fine for us.
Many thanks to
Client script:
function onChange(control, oldValue, newValue, isLoading) {
var headers = g_form.getControl('u_region').parentElement.querySelectorAll('.col-xs-4');
var collectorName = 'u_region';
var filterString = '';
if(newValue == 'Australia'){
filterString = 'question.nameSTARTSWITHu_region^textNOT LIKEAustralia';
}
else if(newValue == 'Austria')
{
filterString = 'question.nameSTARTSWITHu_region^textNOT LIKEAustria';
}
setCollectorFilter();
function setCollectorFilter()
{
//If it hasn't rendered yet, wait 100ms and try again.
if(typeof(window[collectorName + 'g_filter']) == 'undefined')
{
setTimeout(setCollectorFilter, 50);
return;
}
//Reset the filter query
window[collectorName + 'g_filter'].reset();
window[collectorName + 'g_filter'].setQuery(filterString);
window[collectorName + 'acRequest'](null);
//Redisplay the list collector variable
//g_form.setDisplay(collectorName,true);
}
}