|
<ej:schedule id="Schedule1" clientidmode="Static" height="525px" width="100%" currentdate="5/5/2014" runat="server" datasourceid="SqlDataSource1" BeforeAppointmentCreate="onBeforeAppointmentCreate" CellClick="onCellClick">
<AppointmentSettings Id="Id" Subject="Subject" AllDay="AllDay" StartTime="StartTime" EndTime="EndTime" Recurrence="Recurrence" RecurrenceRule="RecurrenceRule" />
</ej:schedule>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>" SelectCommand="SELECT * FROM [Appointment]"></asp:SqlDataSource>
var tar, col = 0, count = 0;
function onCellClick(args) {;
tar = args.target.currentTarget;
}
function onBeforeAppointmentCreate(args) {
app = ej.isNullOrUndefined(args.appointment[0]) ? args.appointment : args.appointment[0];
overlapList = this._overlapApp(app["AppTaskId"], app[this._appointmentSettings["startTime"]], app[this._appointmentSettings["endTime"]], null);
if (overlapList.length > 0) {
args.cancel = true;
tarInterval = setInterval(changeMarqueeColor, 500);
}
}
function changeMarqueeColor() {
$(tar).removeClass('e-selectedCell');
if (col == 0) {
$(tar).css("background-color", "red");
col = 1;
}
else {
$(tar).css("background-color", "blue");
col = 0;
}
count++;
if (count == 10) {
clearInterval(tarInterval);
}
} |