Merge jquery selector [javascipt string concat] : I'm trying to make a jquery-selector generator for my two filters - the aim is just hidding some elements in a calendar -

If I filter on the group DB_ID 2 and on the personn DB_ID 1 I would like to generate the following selector : 
`#mod_calendar .gid_2.pid_1` 

If I filter on the group DB_ID 2 I would like to generate the following selector : `#mod_calendar .gid_2` 

If I filter on the personn DB_ID 1 I would like to generate the following selector : `#mod_calendar .pid_1`

If I filter on the group DB_ID 2,5,6,8 and on the personn DB_ID 1 I would like to generate the following selector : 
`#mod_calendar .gid_2.pid_1,#mod_calendar .gid_5.pid_1,#mod_calendar .gid_6.pid_1,#mod_calendar .gid_8.pid_1`

If I filter on the group DB_ID 2,5,6,8 and on the personn DB_ID 1,2 I would like to generate the following selector : 
`#mod_calendar .gid_2.pid_1,#mod_calendar .gid_5.pid_1,#mod_calendar .gid_6.pid_1,#mod_calendar .gid_8.pid_1#mod_calendar .gid_2.pid_2,#mod_calendar .gid_5.pid_2,#mod_calendar .gid_6.pid_2,#mod_calendar .gid_8.pid_2`

And so one, I think you get the point...
this https://jsfiddle.net/5mr60f6p/ is what I tried so far but I'm kind of stuck at the moment.


