jqxScheduler records the changes made to its appointments - moved, resized, edited, added or deleted - so that they can be undone and redone with the undo and redo methods or with Ctrl+Z and Ctrl+Y.
A live JavaScript/jQuery example of jqxScheduler, the jQWidgets Scheduler component, with its complete source code below. It is one of 45 jqxScheduler demos for jQuery.
appointmentDataFields property – Sets or gets the appointments data fields.disabled property – Sets or gets whether the Scheduler is disabled.date property – Sets or gets the Scheduler's Date.height property – Sets or gets the Scheduler's height.ready property – Sets a function called when the Scheduler is rendered and ready for usage.resources property – Sets or gets the Scheduler's resource object.showLegend property – Sets or gets whether the Scheduler's legend bar is displayed.source property – Sets or gets the Scheduler appointments data source.undoRedo property – Sets or gets whether the scheduler records the user's changes - adding, moving, resizing, editing and deleting appointments, from the mouse, the keyboard,…undoRedoLimit property – Sets or gets how many changes the undo method can take back; 0 for no limit.views property – Sets or gets the Scheduler's views.view property – Sets or gets the Scheduler's view.width property – Sets or gets the Scheduler's width.appointmentChange event – This event is triggered when an appointment is changed.appointmentDelete event – This event is triggered when an appointment is deleted.appointmentAdd event – This event is triggered when an appointment is added.undoRedoChange event – This event is triggered when what can be undone or redone changes: a change is recorded, undo or redo is called, or the history is cleared.scrollToTime method – Scrolls the day or week view so that a time of day is at its top, for example the start of the working day.undo method – Takes back the last recorded change.redo method – Applies again the last change that undo took back.To run it in your own page, load jqx.base.css, a theme and the library files below from npm (npm install jqwidgets-scripts) or the jsDelivr CDN, then add the markup and the script. jQuery is not required: jqxcore.js provides $. Getting started with jqxScheduler shows the setup step by step.
The page loads jqx.base.css, a theme and these library files: jqxcore.js, jqxbuttons.js, jqxscrollbar.js, jqxdata.js, jqxdate.js, jqxscheduler.js, jqxscheduler.api.js, jqxdatetimeinput.js, jqxmenu.js, jqxcalendar.js, jqxtooltip.js, jqxwindow.js, jqxcheckbox.js, jqxlistbox.js, jqxdropdownlist.js, jqxnumberinput.js, jqxradiobutton.js, jqxinput.js.
It also loads helper scripts of this demo site, which are not part of the library: demos.js (getWidth() and other layout helpers).
$(document).ready(function () {
var day = function (date, hour, minute) {
return new Date(2026, 10, date, hour, minute || 0, 0);
}
var appointments = [
{ id: "review", subject: "Quarterly project review", calendar: "Room 1", start: day(17, 9), end: day(17, 12) },
{ id: "itgroup", subject: "IT group meeting", calendar: "Room 2", start: day(18, 10), end: day(18, 12) },
{ id: "course", subject: "Social media course", calendar: "Room 3", start: day(19, 13), end: day(19, 15) },
{ id: "planning", subject: "New projects planning", calendar: "Room 2", start: day(20, 9), end: day(20, 11) },
{ id: "interview", subject: "Interview with James", calendar: "Room 1", start: day(20, 14), end: day(20, 15) }
];
var source =
{
dataType: "array",
dataFields: [
{ name: 'id', type: 'string' },
{ name: 'subject', type: 'string' },
{ name: 'calendar', type: 'string' },
{ name: 'start', type: 'date' },
{ name: 'end', type: 'date' }
],
id: 'id',
localData: appointments
};
var adapter = new $.jqx.dataAdapter(source);
$("#scheduler").jqxScheduler({
date: new $.jqx.date(2026, 11, 18),
width: '100%',
height: 560,
source: adapter,
view: 'weekView',
showLegend: true,
// the defaults, written out: changes are recorded, up to the last 100
undoRedo: true,
undoRedoLimit: 100,
// the meetings have times: no all-day row
showAllDayRow: false,
ready: function () {
$("#scheduler").jqxScheduler('scrollToTime', 8);
},
resources:
{
colorScheme: "scheme05",
dataField: "calendar",
source: new $.jqx.dataAdapter(source)
},
appointmentDataFields:
{
from: "start",
to: "end",
id: "id",
subject: "subject",
resourceId: "calendar"
},
views: [
{ type: 'dayView', timeRuler: { formatString: 'HH:mm' } },
{ type: 'weekView', timeRuler: { formatString: 'HH:mm' } },
'monthView'
]
});
$("#undo").jqxButton({ width: 80, disabled: true });
$("#redo").jqxButton({ width: 80, disabled: true });
$("#undo").on('click', function () {
$("#scheduler").jqxScheduler('undo');
});
$("#redo").on('click', function () {
$("#scheduler").jqxScheduler('redo');
});
// the buttons follow what there is to undo and redo
$("#scheduler").on('undoRedoChange', function (event) {
$("#undo").jqxButton({ disabled: !event.args.canUndo });
$("#redo").jqxButton({ disabled: !event.args.canRedo });
});
var log = function (text) {
$("#log").prepend($("<div></div>").text(new Date().toLocaleTimeString() + " " + text));
}
var describe = function (appointment) {
return "“" + appointment.subject + "” " + appointment.from.toString('ddd HH:mm') + "-" + appointment.to.toString('HH:mm');
}
// event.args.action says when undo or redo caused the change
$("#scheduler").on('appointmentChange', function (event) {
log((event.args.action ? event.args.action + ": " : "") + "changed " + describe(event.args.appointment));
});
$("#scheduler").on('appointmentAdd', function (event) {
log((event.args.action ? event.args.action + ": " : "") + "added " + describe(event.args.appointment));
});
$("#scheduler").on('appointmentDelete', function (event) {
log((event.args.action ? event.args.action + ": " : "") + "deleted " + describe(event.args.appointment));
});
});
<div id="content" class="demo">
<div class="demo-bar">
<input type="button" id="undo" value="Undo">
<input type="button" id="redo" value="Redo">
<span class="hint">Move, resize, edit, add or delete appointments, then press Ctrl+Z to undo and Ctrl+Y to redo.</span>
</div>
<div id="scheduler"></div>
<div id="log" class="demo-log" aria-label="Changes" aria-live="polite"></div>
</div>