This is a migrated thread and some comments may be shown as answers.

Recurrence EventTemplate

5 Answers 101 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Zoran
Top achievements
Rank 1
Zoran asked on 24 Nov 2015, 05:47 PM

I have an event template:

<script id="event-template" type="text/x-kendo-template">
    <div style='background-color: #=Color#'>
        <span>#= title #</span>
    </div>
</script>

I base the color on the start date of the event which works fine for all events except for those with recurrence events.

Since the parent recurrence event was set up in the past it displays the color data from the parent and not the actual recurrence event which is in the future.

How can I setup the recurrence event data when it is displayed on the scheduler?

 

5 Answers, 1 is accepted

Sort by
0
Zoran
Top achievements
Rank 1
answered on 24 Nov 2015, 06:26 PM

Fixed it:

<script id="event-template" type="text/x-kendo-template">
    #if(start >= new Date()){#
        <div style='background-color: blue'>

     #}else{#
            # if (ProcedureCode == null) {#
        <div style='background-color: gray'>
            #}else{#
            <div style='background-color: darkgreen'>
                #}#
                #}#
                <span>#= title #</span>
            </div>
</script>

 

But if the event length is longer than the title, it shows the default background.

0
Georgi Krustev
Telerik team
answered on 26 Nov 2015, 09:45 AM
Hello Zoran,

The described issue seems be a styling problem that should be addressed with custom CSS. Could you send us a repro demo (Dojo or smth else), which we can review locally? Thus we will be able to fully understand the case and suggest the most suitable solution promptly.

Regards,
Georgi Krustev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Georgi Krustev
Telerik team
answered on 26 Nov 2015, 10:20 AM
Hello Zoran,

I would like to follow up my last message to provide additional details about the styling.

If you would like to change the background of the event with CSS class name, then you can use the following approach: Another option is to render the custom CSS class in the event template and then manually move that class to the div.k-event element in the widget's dataBound event. Thus the styling will be applied to the whole event element.

Regards,
Georgi Krustev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Zoran
Top achievements
Rank 1
answered on 01 Dec 2015, 01:52 PM

So I changed the event template to this:

 <script id="event-template" type="text/x-kendo-template">
    <div class="movie-template">
      <h3>#: title #</h3>
      </div>
    </script>

And you can see that the red background now shows for your events as well.

0
Georgi Krustev
Telerik team
answered on 03 Dec 2015, 09:57 AM
Hello Zoran,

The approach is the same - you need to set margin:0 to the first element in the template:
Regards,
Georgi Krustev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
Zoran
Top achievements
Rank 1
Answers by
Zoran
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or