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

Kendo Scheduler event dynamic Title with multiline text

4 Answers 646 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Anamika
Top achievements
Rank 1
Anamika asked on 21 Aug 2017, 12:32 PM

Hello,

In my Scheduler Event the Title consists of start-end time  followed by description, new line , Adress , New Line , phone number etc.

I am using \r\n for new line but Looks like the Title does not recognize new line characters. I cannot use a fixed template as the fields and where the new line Comes is dynamic.

How can i achieve this.

 

Thanks

 

Anamika

4 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 23 Aug 2017, 10:40 AM
Hi Anamika,

As the Title text of the event gets escaped, no special symbols / mark-up elements to signify a new line would allow you to actually display new line. What I could suggest you is to manually inject the required line breaks, handling the Scheduler.dataBound event:
dataBound: function(e) {
  var events = $('.k-event-template');
   
  for(var i = 0; i < events.length; i += 1) {
    var currentEvent = $(events[i]);
    var initialText = currentEvent.text();
    var modifiedHtml = initialText.replace(new RegExp('{place break here}', 'g'), '<br/>');
    currentEvent.html(modifiedHtml);
  }
},

where {place break here} is the placeholder, which should be replaced with the <br/> element.

Here you will find a simple Dojo, implementing the above.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Anamika
Top achievements
Rank 1
answered on 23 Aug 2017, 12:05 PM
Thanks Vesen , that did the trick
0
vinay
Top achievements
Rank 1
answered on 23 Nov 2020, 06:27 AM
Can we add icons to kendo scheduler? on icon click open the URL in window? I'm looking for  
0
Veselin Tsvetanov
Telerik team
answered on 24 Nov 2020, 12:15 PM

Hi Vinay,

You could place icons and any other content in a Scheduler event element by implementing an Event template. Here is a demo on that:

https://demos.telerik.com/aspnet-mvc/scheduler/templates

Regards,
Veselin Tsvetanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Scheduler
Asked by
Anamika
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Anamika
Top achievements
Rank 1
vinay
Top achievements
Rank 1
Share this question
or