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

hide an All day event with template

3 Answers 312 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 11 Oct 2016, 03:36 PM

Hello!!!

I'm using MVC Scheduler with a all day event template. 

<script id="event-template" type="text/x-kendo-template">
    #if(data.IsControl && hasControlElement(data)) {#
            #= title#
     #}else {#
    <div class="amagat">
    </div>
    #}#
</script>

I want to hide all the events with the template that contains <div class="amagat"/>

I've tried it by javascript and css, but no luck... 

<style>
    .k-event > .amagat {visibility: hidden ; display: none}
</style>

 

I've attached two images with the current result and the desired result.

 

Thanks!!

3 Answers, 1 is accepted

Sort by
0
Accepted
Veselin Tsvetanov
Telerik team
answered on 13 Oct 2016, 06:27 AM
Hi Carlos,

As CSS does not offer to select a parent (in your case the k-event <div>), based on a condition in its children (in your case the class amagat), you won't be able to achieve the desired using pure CSS. Instead, you will have to manually change the styles of those parent elements using jQuery:
$('.k-event>.amagat').parent().css('visibility', 'hidden').css('display', 'none');

Regards,
Veselin Tsvetanov
Telerik by Progress
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
Carlos
Top achievements
Rank 1
answered on 19 Oct 2016, 08:13 AM

Hello!!! Thanks for you answer!

But I don't have the expected result... it does nothing

where do I put it???

in the  $(document).ready(function () {})) ???

0
Accepted
Veselin Tsvetanov
Telerik team
answered on 20 Oct 2016, 03:13 PM
Hello Carlos,

You should call that function on the initial load of the widget, after the Scheduler content has already been rendered. You could do that in the $(document).ready(function(){....});. However, I would recommend you to use instead the dataBound() event of the Scheduler, which will be fired on each navigation / update / insert / remove executed on the Scheduler.

Regards,
Veselin Tsvetanov
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
Scheduler
Asked by
Carlos
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Carlos
Top achievements
Rank 1
Share this question
or