Filter view from multi select combo

Hi I am trying to filter the scheduler view. I want to display the selected courses from a drop down view. using the code below, if I supply 1 courseID it works but when I supply multiple id’s it displays all courses.

I am using the built in Month view.

i.e from console
$(’#combo_course_multi’).val()
(2) [“238”, “256”]
0: “238”
1: “256”
length: 2__proto__: Array(0)

event_select_filters.course = $(’#combo_course_multi’).val();

Any help would be appreciated!

Thank you!

So I am looping through an array to display each course’s events. Here is the code I am using…
The reason I am creating a new array is because if I use the event_select_filters in the for loop it hangs.

Thanks, Hope this helps someone.

            if (event_select_filters.course ) {
                let coursesArray = event_select_filters.course;
                for (let x = 0; x < coursesArray.length; x++) {
                    display = false;
                    if (coursesArray[x] == event.course) {
                        display = true;
                        break;
                    }
                }
            }

Hello @RonM

Thank you for sharing your solution!

1 Like

Hi @Polina

I try and put my solution in so it helps others. I hate when people say they found a solution but do not give any info.

thanks, always get great forum help from you guys!

@RonM
Yes, I agree with you. It can help others if they encounter a similar issue.