1

I have a kendo date picker defined as follows:

<input id="datePicker" data-format="dd.MM.yyyy" data-month='{ "content": "&lt;span class=\"#= dateRange.hasReport(data.date) ? \"boldDate\" : \"normalDate\" #\"&gt;#=data.value #&lt;/span&gt;" }' data-role="datepicker" data-bind="value: new Date(), events: {change: dateChanged}" style="width:150px;" />

In the month template, I bold some dates depending on whether there is a report or not for that date by a call to the method dateRange.hasReport(data.date)

Now, there is an external event which causes the daterange to change. I want to now refresh the calender view so that the dateRange.hasReport is called for all dates again.

I am unable to find a way to do this.

Any ideas?

NEHAVERMA8
  • 251
  • 1
  • 8
  • 22

2 Answers2

1

Use the methods min(), max() to change your ranges and the 'change' event will be triggered I guess. You can bind your function there if you want.

http://docs.kendoui.com/api/web/datepicker

AntouanK
  • 4,880
  • 1
  • 21
  • 26
  • +1 Yes, We can trigger the `change` event. But not sure it will update `month view`, Some how the Link reference content has been altered. So, Look at this thread [How do I trigger the Change Event](http://stackoverflow.com/questions/15716402/how-do-i-raise-the-change-event-in-the-kendoui-datepicker) – RajeshKdev Sep 19 '14 at 06:52
1

I fixed it by destroying the element and recreating it again

$("#datePicker").data("kendoDatePicker").destroy();
$('#datePicker').empty();
createDatePicker(); //Creates the datepicker widget again
$("#datePicker").closest("span.k-datepicker").width(150);
NEHAVERMA8
  • 251
  • 1
  • 8
  • 22