UNPKG

jqwidgets-framework

Version:

jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.

166 lines (152 loc) 8.61 kB
<!DOCTYPE html> <html lang="en"> <head> <title id='Description'> jqxScheduler Events example </title> <link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" /> <script type="text/javascript" src="../../../scripts/jquery-1.12.4.min.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxdate.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxscheduler.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxscheduler.api.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxdatetimeinput.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxmenu.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcalendar.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxtooltip.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxwindow.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcheckbox.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxnumberinput.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxradiobutton.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxinput.js"></script> <script type="text/javascript" src="../../../jqwidgets/globalization/globalize.js"></script> <script type="text/javascript" src="../../../jqwidgets/globalization/globalize.culture.de-DE.js"></script> <script type="text/javascript" src="../../../scripts/demos.js"></script> <script type="text/javascript"> $(document).ready(function () { // prepare the data var source = { dataType: 'json', dataFields: [ { name: 'id', type: 'string' }, { name: 'status', type: 'string' }, { name: 'about', type: 'string' }, { name: 'address', type: 'string' }, { name: 'company', type: 'string'}, { name: 'name', type: 'string' }, { name: 'style', type: 'string' }, { name: 'calendar', type: 'string' }, { name: 'start', type: 'date', format: "yyyy-MM-dd HH:mm" }, { name: 'end', type: 'date', format: "yyyy-MM-dd HH:mm" } ], id: 'id', url: '../../sampledata/appointments.txt' }; var adapter = new $.jqx.dataAdapter(source); $("#scheduler").jqxScheduler({ date: new $.jqx.date(2017, 11, 23), width: getWidth("Scheduler"), height: 600, rowsHeight: 40, source: adapter, ready: function () { // gets scrollbable height. var scrollHeight = $("#scheduler").jqxScheduler('scrollHeight'); // scroll 700px. $("#scheduler").jqxScheduler('scrollTop', 700); }, appointmentDataFields: { from: "start", to: "end", id: "id", description: "about", location: "address", subject: "name", style: "style", status: "status" }, view: 'weekView', views: [ "dayView", "weekView" ] }); $("#scheduler").on('appointmentDelete', function (event) { var args = event.args; var appointment = args.appointment; $("#log").html("appointmentDelete is raised"); }); $("#scheduler").on('appointmentAdd', function (event) { var args = event.args; var appointment = args.appointment; $("#log").html("appointmentAdd is raised"); }); $("#scheduler").on('appointmentDoubleClick', function (event) { var args = event.args; var appointment = args.appointment; // appointment fields // originalData - the bound data. // from - jqxDate object which returns when appointment starts. // to - jqxDate objet which returns when appointment ends. // status - String which returns the appointment's status("busy", "tentative", "outOfOffice", "free", ""). // resourceId - String which returns the appointment's resouzeId // hidden - Boolean which returns whether the appointment is visible. // allDay - Boolean which returns whether the appointment is allDay Appointment. // resiable - Boolean which returns whether the appointment is resiable Appointment. // draggable - Boolean which returns whether the appointment is resiable Appointment. // id - String or Number which returns the appointment's ID. // subject - String which returns the appointment's subject. // location - String which returns the appointment's location. // description - String which returns the appointment's description. // tooltip - String which returns the appointment's tooltip. $("#log").html("appointmentDoubleClick is raised"); }); $("#scheduler").on('cellClick', function (event) { var args = event.args; var cell = args.cell; $("#log").html("cellClick is raised"); }); $("#scheduler").on('appointmentChange', function (event) { var args = event.args; var appointment = args.appointment; // appointment fields // originalData - the bound data. // from - jqxDate object which returns when appointment starts. // to - jqxDate objet which returns when appointment ends. // status - String which returns the appointment's status("busy", "tentative", "outOfOffice", "free", ""). // resourceId - String which returns the appointment's resouzeId // hidden - Boolean which returns whether the appointment is visible. // allDay - Boolean which returns whether the appointment is allDay Appointment. // resiable - Boolean which returns whether the appointment is resiable Appointment. // draggable - Boolean which returns whether the appointment is resiable Appointment. // id - String or Number which returns the appointment's ID. // subject - String which returns the appointment's subject. // location - String which returns the appointment's location. // description - String which returns the appointment's description. // tooltip - String which returns the appointment's tooltip. $("#log").html("appointmentChange is raised"); }); }); </script> </head> <body class='default'> <div id="scheduler"></div> <br /> Event Log: <div id="log"> </div> <div style="position: absolute; bottom: 5px; right: 5px;"> <a href="https://www.jqwidgets.com/" alt="https://www.jqwidgets.com/"><img alt="https://www.jqwidgets.com/" title="https://www.jqwidgets.com/" src="https://www.jqwidgets.com/wp-content/design/i/logo-jqwidgets.png"/></a> </div> </body> </html>