Remove Conditions From Model Using JS

  • 1
  • Question
  • Updated 2 years ago
  • (Edited)
Hi All,

I've got a Calendar (the option "Remember user's last Date" is disabled) linked to a model. Based on user interactions the calendar can be shown or hidden (as often as the user wants). If you switch the date (either with the arrows or selecting another date with the datepicker) everything gets displayed just fine.
However if the Calendar is hidden and then shown again, the calendar doesn't remove the old date conditions and adds new conditions to the model. Based on that (the conditions are linked with AND) the model returns 0 rows and doesn't display anything in the calendar.
If I check the option "Remember user's last Date", the calendar works a few times and then removes all conditions and doesn't add new ones for the selected date.

My question:
Is there a way to remove the old conditions or add new ones using JS? Or is there an other way to remove the conditions?

Any help is much appreciated
Photo of David Giger

David Giger

  • 1,758 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
David~

Not sure how you're setting the conditions to begin with but what about some combination of the following using the action framework: deactivate model condition when they hide the calendar and then using set & activate model condition when the user wants to show the calendar again? 

Thanks!
Karen