问题
I downloaded multiDatesPicker here: http://multidatespickr.sourceforge.net
My Problem is..
I'm using multiDatesPicker only for represent added dates by codes.
And I don't want to receive any user interaction.
The only thing that how to disabling multiDatesPicker I know is "disabled: true" option. but this makes the calendar's added dates button color changed.
I already tried changing opacity using css(.ui-state-disabled) but it was just opacity.
Is there anyone who know how to just disabling calendar without changing anything that we can see ?
回答1:
self answer
this solution is work in both datepicker and multidatespicker. just follow 2 steps
First, change javascript
in your "jquery.ui.datepicker.js" source codes, find below
(unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' :
'<a class="ui-state-default' + ..
and change this to:
(/*(unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' :
*/'<a class="ui-state-default' +
Second, add css style
#yourCal .ui-state-disabled {
BACKGROUND-IMAGE: none; FILTER: none; opacity: .99;
}
.ui-datepicker .ui-datepicker-calendar .ui-state-highlight a {
background: #743620 none;
color: white;
}
回答2:
just add this one more option to your datepicker initialization code, it worked
onSelect:function (dateText, inst) {
var newDate = new Date();
inst.drawMonth = newDate.getMonth();
inst.drawYear = newDate.getFullYear();
inst.currentMonth = newDate.getMonth();
inst.currentYear = newDate.getFullYear();
}
来源:https://stackoverflow.com/questions/12318505/multidatespicker-how-to-disable-clicking-without-changing-date-button-color