This is regarding selectionchanging on webMonthCalendar. In my javascript function I need to change the selected day, after adding a custom day. I did it, but my change won’t remain after possback. Control will set the custom day as its selected day, after possback. As a result of this, selectionchanging won’t happen in the second selection of that particular day.Please help me to solve this problem.
It was not clear.can you share and explain the code?
Hi bgnanaprakash,
I was sorted out the above problem by using mouse down event. Below is the code I used.
function calendarMouseDown(cal, args) {
var id = cal.idFromMouse(args.get_browserEvent());
if (id < 0 || id > 41)
return;
var day = cal.get_days()[id];
var selectedType = document.getElementById("txtHiddenHolidayType").value;
var oldStyle = "";
if (selectedType != "") {
var style = GetSelectedStyle(selectedType);
if (cal._cd0 != null) {
for (var i = 0; i < cal._cd0.length; i++) {
if (cal._cd0[i].day == day.get_day() && cal._cd0[i].month == day.get_month() && cal._cd0[i].year == day.get_year()) {
oldStyle = cal._cd0[i].css;
break;
}
if (style == oldStyle) {
var arrMonths = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
var strDate_Style = "" + " " + arrMonths[day.get_month() - 1] + " " + day.get_day() + " " + "xx" + " " + "xxx" + " " + day.get_year() + "#" + 7 + "%";
document.getElementById("txtHiddenDateCollection").value = document.getElementById("txtHiddenDateCollection").value + strDate_Style;
cal.addCustomDay(day.get_year(), day.get_month(), day.get_day(), "", "", "", "Trading_Day");
isUnSelect = 'True';
else
isUnSelect = 'False';