jquery datepicker refresh method is not working

jquery

Solution

I got to know the problem here . We need to set async:false for ajax call that is

$.ajax({async:false});

It works fine now.

Problem

I am highlighting some days in a month depending on the data coming from backend . When i cahnge month or year , again am calling ajax call . But datepicker shows only previous dates . My code is as follows, ``` $("input.dC").live('click',function() { $(this).datepicker({ showOn:'focus', changeMonth:'true', changeYear:'true', onChangeMonthYear:function(year,month,inst) { var date = new Date(year,month-1); obj.suggestDates(date); $("#"+inst.id).datepicker("refresh"); }, beforeShowDay:function(date){ for(i=0;i<obj.r.length;i++) { var m = obj.r[i]; if(date.getMonth() == m[1] && date.getDate() == m[0] && date.getFullYear() == m[2]) { return[true,"ui-state-highlight"];} } return[false,""]; } }).focus(); }); obj.prototype.suggestDates=function(d){ //ajax call here //obj.r=response; } ```

Original source