title: The dates to be highlighted in the Kendo calender only works on alert
body: <p>I have seen many question about 'JavaScript works only on alert', but the answers are specific to those question only. I am using Kendo Calender and want to highlight specific dates from the value in the database. The below code works fine only when an alert is written.Kindly help: </p>
  
  <pre><code> var duedates = [];
       function GetDueDates() {
                       $.ajax({
                       type: "POST",
                       url: "ChartBinder.asmx/GetDueDates",
                       data: '{}',
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       success: function (msg) {
                           duedates = $.parseJSON(msg.d);      
                       },
                       error: function (msg) {    
                           alert("error");
                       }    
                   });
                 }
  
  
    $(document).ready(function () {
                 GetDueDates();   
  </code></pre>
  
  <p>//Functionality works when alert is inserted here..</p>
  
  <pre><code>               var today = new Date();
                 $("#calendar").kendoCalendar({
                     change: onChange,
                     navigate: onNavigate,
                     value: today,
                     dates: duedates,
                     month: {
                         // template for dates in month view
                         content: '# if ($.inArray(+data.date, data.dates) != -1) { #' +
                                      '&lt;div class="' +
                                             "dataexist" +
                                               '"&gt;&lt;/div&gt;' +
                                   '# } #' +
                                   '#= data.value #'
                     },
                     footer: "Today - #=kendo.toString(data, 'd') #"
  
                 });          
  
             $(document).find("#panelbar").kendoPanelBar({
                 expandMode: "single"
             });
         });
  </code></pre>