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
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
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/.