Hi,
I'm using the slot template to show recommended events for each resource groups. My problem I am having is when I switch from one group to another the slot template just adds on to the slot template instead of replacing the existing one. Is there a way to reset the slot template each time you change the group view?
I attached images below to show the what happens when I go from Rooms to Providers, and then how Providers should look.
Thanks,
6 Answers, 1 is accepted
Could you please provide the runable example where the issue is reproduced as from the provided information it's not clear for us what is the exact scenario that you have? This would help us advice you better how to proceed.
Regards,
Vladimir Iliev
Telerik
Hi Vlad,
Here's an example to reproduce the issue.
http://dojo.telerik.com/@michael.taylor/abOvE/15
Thanks,
Thank you for the provided example - after inspecting the demo it appears that the reason for current behavior is that for "providers" group more than one "div" element is rendered for each slot. Due to the current styles applied to the "div" elements they are overflowing the slot which causes current look.
'# if((date >= start && date < end) && ( "'
+ $scope.resourceSelected +
'" == "Providers" && type.providerId == resources.providerId)) { # '
+
' <div class="" style="background: #=type.color#; float: left; width: 6px; height: 138%; margin: -0.334em -.5em; opacity: 0.5">'
+
'# if((date >= start && date < end) && ( "'
+ $scope.resourceSelected +
'" == "Rooms" && type.roomId == resources.roomId)) { # '
+
' <div class="" style="background: #=type.color#; float: left; width: 6px; height: 138%; margin: -0.334em 0em; opacity: 0.5">'
+
' </div>'
+
'# } # '
+
'# if((date >= start && date < end) && type.providerId == null && type.roomId == null) { # '
+
' <div class="" style="background: #=type.color#;float: left; width: 6px; height: 138%; margin: -0.334em .5em; opacity: 0.5">'
+
' </div>'
+
'# } # '
+
'#}); #'
;
Regards,
Vladimir Iliev
Telerik
You're correct, this would fix the overlapping. My issue is that it does not to remove the "div"s created from a group when I switch to a new group. Each slot is only to be expected to have one "div" element. Is there a way to achieve that?
You can achieve the desired behavior by improving current template - more than one div elements are rendered due to the current logic which is used in the template (when groups are changed previous div elements are cleared correctly).
Regards,
Vladimir Iliev
Telerik
Hi Vlad,
I'm glad it was just my logic. I didn't understand slot template to the full extent. Now that I know it only gets touched on initialization of the scheduler I can form my logic around that.
I posted my example that resolved my issue to help anyone that needs an understanding some of the logic the slot template needs to separate the resources. It's not the best, but hope it helps!
http://dojo.telerik.com/@michael.taylor/abOvE/21
Thanks,