This repository was archived by the owner on Jul 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmulti-selection.js
More file actions
59 lines (59 loc) · 3.9 KB
/
multi-selection.js
File metadata and controls
59 lines (59 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var ej2_react_calendars_1 = require("@syncfusion/ej2-react-calendars");
var sample_base_1 = require("../common/sample-base");
require("./calendar-component.css");
var MultipleSelection = (function (_super) {
__extends(MultipleSelection, _super);
function MultipleSelection() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.selectedValues = [new Date(new Date().getFullYear(), new Date().getMonth(), 10), new Date(new Date().getFullYear(), new Date().getMonth(), 15),
new Date(new Date().getFullYear(), new Date().getMonth(), 25)];
return _this;
}
MultipleSelection.prototype.onchange = function () {
var element = document.getElementById('multiSelect');
element.innerHTML = '';
for (var index = 0; index < this.calendarInstance.values.length; index++) {
element.insertBefore(document.createTextNode(this.calendarInstance.values[index].toString()), element.childNodes[0]);
element.insertBefore(document.createElement('br'), element.childNodes[0]);
}
};
MultipleSelection.prototype.render = function () {
var _this = this;
return (React.createElement("div", { className: "col-lg-12 control-section" },
React.createElement("div", { id: "control_wrapper", className: "col-lg-6 col-sm-8 col-md-8 multiselectWrapper" },
React.createElement("div", { className: 'calendar-control-section', style: { overflow: 'auto' } },
React.createElement(ej2_react_calendars_1.CalendarComponent, { id: "calendar", isMultiSelection: true, values: this.selectedValues, ref: function (scope) { _this.calendarInstance = scope; }, change: this.onchange.bind(this), created: this.onchange.bind(this) }))),
React.createElement("div", { className: "valuesWrapper col-lg-6 col-sm-8 col-md-8" },
React.createElement("h5", null, "Selected values"),
React.createElement("div", { className: "contentValue" },
React.createElement("div", { id: "multiSelect" }))),
React.createElement("div", { id: "action-description" },
React.createElement("p", null, "The following sample demonstrates the multiple date selection functionalities of the Calendar. Click the desired date from the calendar and the selected date will be added to the values property of the calendar.")),
React.createElement("div", { id: "description" },
React.createElement("p", null,
"Multi selection sample demonstrates, how to enable and select the multiple date in a calendar by using",
React.createElement("code", null, "isMultiSelection"),
" and",
React.createElement("code", null, "values"),
" properties . Here 10, 15 and 25 date's are selected."),
React.createElement("p", null,
"More information on the calendar instantiation can be found in this",
React.createElement("a", { href: "https://ej2.syncfusion.com/documentation/calendar/getting-started.html#create-a-simple-calendar", target: "_blank" }, "documentation section"),
"."))));
};
return MultipleSelection;
}(sample_base_1.SampleBase));
exports.MultipleSelection = MultipleSelection;