how to have multi select choice in jelly script interactive filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2023 08:10 AM
How to modify below jelly script to have multi selection value ?
refer the image, now i am able to select only one value .Need to change that to multi selection value.
..............................
Code is written in dynamic content block interactive filter.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_tasktypes" object="true" jelly="true">
var obj=[];
var gr= new GlideRecord('u_one_team_workflow_location');
gr.addEncodedQuery('u_active=true');
gr.orderBy('u_name');
gr.query();
while(gr.next()){
obj.push([gr.getValue('u_name')]);
}
obj;
</g:evaluate>
<select id='filter_task_type' class='select2-search' onchange='filterTaskType()'>
<option value="">All</option>
<j:forEach var="jvar_tasktype" items="${jvar_tasktypes}">
<option value="${jvar_tasktype[0]}">${jvar_tasktype[0]}</option>
</j:forEach>
</select>
<script>
var dbh = new DashboardMessageHandler("filter_tasktype");
function filterTaskType(){
var status = $j('#filter_task_type').val();
if (status)
dbh.publishFilter('u_request_item_location_mapping_talent_related_request', 'location_u_name=' + status); <!-- change the cat_item sys_id and variable.sys_id with actual sys id of catalog item and target variable. -->
else
dbh.removeFilter();
}
filterTaskType();
</script>
</j:jelly>
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2023 02:59 PM
Wow I have the exact same requirement, if I work it out. I will reply to your message.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2023 03:58 PM
That is a html features, so all you need to do is add 'multiple='true' to the select line
As in :
<select id='jvar_name' class='select2-search' onchange='filterTaskType()' multiple='true'>
<option value="">All</option>
<j:forEach var="jvar_app" items="${jvar_app_name}">
<option value="${jvar_app[1]}">${jvar_app[1]}</option>
</j:forEach>
</select>
It worked fine for me. Hope that helps you.
Gary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2025 01:51 PM
Do you have a screenshot of how the multiple select UI looked once you got it working?