Debian Codegraph @

dojox/calendar/CalendarBase.js

raw symbols SCIP
1 define([
2 "dojo/_base/declare",
3 "dojo/_base/sniff",
4 "dojo/_base/event",
5 "dojo/_base/lang",
6 "dojo/_base/array",
7 "dojo/cldr/supplemental",
8 "dojo/dom",
9 "dojo/dom-class",
10 "dojo/dom-style",
11 "dojo/dom-construct",
12 "dojo/dom-geometry",
13 "dojo/date",
14 "dojo/date/locale",
15 "dojo/_base/fx",
16 "dojo/fx",
17 "dojo/on",
18 "dijit/_WidgetBase",
19 "dijit/_TemplatedMixin",
20 "dijit/_WidgetsInTemplateMixin",
21 "./StoreMixin",
22 "./StoreManager",
23 "dojox/widget/_Invalidating",
24 "dojox/widget/Selection",
25 "./time",
26 "dojo/i18n!./nls/buttons"],
27 function(
28 declare,
29 has,
30 event,
31 lang,
32 arr,
33 cldr,
34 dom,
35 domClass,
36 domStyle,
37 domConstruct,
38 domGeometry,
39 date,
40 locale,
41 coreFx,
42 fx,
43 on,
44 _WidgetBase,
45 _TemplatedMixin,
46 _WidgetsInTemplateMixin,
47 StoreMixin,
48 StoreManager,
49 _Invalidating,
50 Selection,
51 timeUtil,
52 _nls){
53
54 /*=====
55 var __HeaderClickEventArgs = {
56 // summary:
57 // A column click event.
58 // index: Integer
59 // The column index.
60 // date: Date
61 // The date displayed by the column.
62 // triggerEvent: Event
63 // The origin event.
64 };
65 =====*/
66
67 /*=====
68 var __TimeIntervalChangeArgs = {
69 // summary:
70 // An time interval change event, dispatched when the calendar displayed time range has changed.
71 // oldStartTime: Date
72 // The start of the previously displayed time interval, if any.
73 // startTime: Date
74 // The new start of the displayed time interval.
75 // oldEndTime: Date
76 // The end of the previously displayed time interval, if any.
77 // endTime: Date
78 // The new end of the displayed time interval.
79 };
80 =====*/
81
82 /*=====
83 var __GridClickEventArgs = {
84 // summary:
85 // The event dispatched when the grid is clicked or double-clicked.
86 // date: Date
87 // The start of the previously displayed time interval, if any.
88 // triggerEvent: Event
89 // The event at the origin of this event.
90 };
91 =====*/
92
93 /*=====
94 var __ItemMouseEventArgs = {
95 // summary:
96 // The event dispatched when an item is clicked, double-clicked or context-clicked.
97 // item: Object
98 // The item clicked.
99 // renderer: dojox/calendar/_RendererMixin
100 // The item renderer clicked.
101 // triggerEvent: Event
102 // The event at the origin of this event.
103 };
104 =====*/
105
106 /*=====
107 var __itemEditingEventArgs = {
108 // summary:
109 // An item editing event.
110 // item: Object
111 // The render item that is being edited. Set/get the startTime and/or endTime properties to customize editing behavior.
112 // storeItem: Object
113 // The real data from the store. DO NOT change properties, but you may use properties of this item in the editing behavior logic.
114 // editKind: String
115 // Kind of edit: "resizeBoth", "resizeStart", "resizeEnd" or "move".
116 // dates: Date[]
117 // The computed date/time of the during the event editing. One entry per edited date (touch use case).
118 // startTime: Date?
119 // The start time of data item.
120 // endTime: Date?
121 // The end time of data item.
122 // sheet: String
123 // For views with several sheets (columns view for example), the sheet when the event occurred.
124 // source: dojox/calendar/ViewBase
125 // The view where the event occurred.
126 // eventSource: String
127 // The device that triggered the event. This property can take the following values:
128 //
129 // - "mouse",
130 // - "keyboard",
131 // - "touch"
132 // triggerEvent: Event
133 // The event at the origin of this event.
134 };
135 =====*/
136
137 /*=====
138 var __rendererLifecycleEventArgs = {
139 // summary:
140 // A renderer lifecycle event.
141 // renderer: Object
142 // The renderer.
143 // source: dojox/calendar/ViewBase
144 // The view where the event occurred.
145 // item:Object?
146 // The item that will be displayed by the renderer for the "rendererCreated" and "rendererReused" events.
147 };
148 =====*/
149
150 /*=====
151 var __ExpandRendererClickEventArgs = {
152 // summary:
153 // A expand renderer click event.
154 // columnIndex: Integer
155 // The column index of the cell.
156 // rowIndex: Integer
157 // The row index of the cell.
158 // date: Date
159 // The date displayed by the cell.
160 // triggerEvent: Event
161 // The origin event.
162 };
163 =====*/
164
165 return declare("dojox.calendar.CalendarBase", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, StoreMixin, _Invalidating, Selection], {
166
167 // summary:
168 // This class defines a generic calendar widget that manages several views to display event in time.
169
170 baseClass: "dojoxCalendar",
171
172 // datePackage: Object
173 // JavaScript namespace to find Calendar routines. Uses Gregorian Calendar routines at dojo.date by default.
174 datePackage: date,
175
176 // startDate: Date
177 // The start date of the displayed time interval.
178 startDate: null,
179
180 // endDate: Date
181 // The end date of the displayed time interval (included).
182 endDate: null,
183
184 // date: Date
185 // The reference date used to determine along with the <code>dateInterval</code>
186 // and <code>dateIntervalSteps</code> properties the time interval to display.
187 date: null,
188
189 // minDate: Date
190 // The minimum date.
191 // If date property is set, the displayed time interval the most in the past
192 // will the time interval containing this date.
193 // If startDate property is set, this mininum value of startDate.
194 minDate: null,
195
196 // maxDate: Date
197 // The maximum date.
198 // If date is set, the displayed time interval the most in the future
199 // will the time interval containing this date.
200 // If endDate property is set, this mininum value of endDate.
201 maxDate: null,
202
203 // dateInterval:String
204 // The date interval used to compute along with the <code>date</code> and
205 // <code>dateIntervalSteps</code> the time interval to display.
206 // Valid values are "day", "week" (default value) and "month".
207 dateInterval: "week",
208
209 // dateIntervalSteps:Integer
210 // The number of date intervals used to compute along with the <code>date</code> and
211 // <code>dateInterval</code> the time interval to display.
212 // Default value is 1.
213 dateIntervalSteps: 1,
214
215 // viewContainer: Node
216 // The DOM node that will contains the views.
217 viewContainer: null,
218
219 // firstDayOfWeek: Integer
220 // (Optional) The first day of week override. By default the first day of week is determined
221 // for the current locale (extracted from the CLDR).
222 // Special value -1 (default value), means use locale dependent value.
223 firstDayOfWeek: -1,
224
225 // formatItemTimeFunc: Function?
226 // Optional function to format the time of day of the item renderers.
227 // The function takes the date, the render data object, the view and the data item as arguments and returns a String.
228 formatItemTimeFunc: null,
229
230 // editable: Boolean
231 // A flag that indicates whether or not the user can edit
232 // items in the data provider.
233 // If <code>true</code>, the item renderers in the control are editable.
234 // The user can click on an item renderer, or use the keyboard or touch devices, to move or resize the associated event.
235 editable: true,
236
237 // moveEnabled: Boolean
238 // A flag that indicates whether the user can move items displayed.
239 // If <code>true</code>, the user can move the items.
240 moveEnabled: true,
241
242 // resizeEnabled: Boolean
243 // A flag that indicates whether the items can be resized.
244 // If <code>true</code>, the control supports resizing of items.
245 resizeEnabled: true,
246
247 // columnView: dojox/calendar/ColumnView
248 // The column view is displaying one day to seven days time intervals.
249 columnView: null,
250
251 // matrixView: dojox/calendar/MatrixView
252 // The column view is displaying time intervals that lasts more than seven days.
253 matrixView: null,
254
255 // columnViewProps: Object
256 // Map of property/value passed to the constructor of the column view.
257 columnViewProps: null,
258
259 // matrixViewProps: Object
260 // Map of property/value passed to the constructor of the matrix view.
261 matrixViewProps: null,
262
263 // createOnGridClick: Boolean
264 // Indicates whether the user can create new event by clicking and dragging the grid.
265 // A createItem function must be defined on the view or the calendar object.
266 createOnGridClick: false,
267
268 // createItemFunc: Function
269 // A user supplied function that creates a new event.
270 // This function is used when createOnGridClick is set to true and the user is clicking and dragging on the grid.
271 // This view takes two parameters:
272 //
273 // - view: the current view,
274 // - d: the date at the clicked location.
275 createItemFunc: null,
276
277 // currentView: ViewBase
278 // The current view displayed by the Calendar object.
279 // The currentViewChange event can be used to react on a view change.
280 currentView: null,
281
282 _currentViewIndex: -1,
283
284 views: null,
285
286 _calendar: "gregorian",
287
288 constructor: function(/*Object*/args){
289 this.views = [];
290
291 this.invalidatingProperties = ["store", "items", "startDate", "endDate", "views",
292 "date", "minDate", "maxDate", "dateInterval", "dateIntervalSteps", "firstDayOfWeek"];
293
294 args = args || {};
295 this._calendar = args.datePackage ? args.datePackage.substr(args.datePackage.lastIndexOf(".")+1) : this._calendar;
296 this.dateModule = args.datePackage ? lang.getObject(args.datePackage, false) : date;
297 this.dateClassObj = this.dateModule.Date || Date;
298 this.dateLocaleModule = args.datePackage ? lang.getObject(args.datePackage+".locale", false) : locale;
299
300 this.invalidateRendering();
301
302 this.storeManager = new StoreManager({owner: this, _ownerItemsProperty: "items"});
303 this.storeManager.on("layoutInvalidated", lang.hitch(this, this._refreshItemsRendering));
304 this.storeManager.on("renderersInvalidated", lang.hitch(this, this._updateRenderers));
305 this.storeManager.on("dataLoaded", lang.hitch(this, function(items){
306 this.set("items", items);
307 }));
308
309 this.decorationStoreManager = new StoreManager({owner: this, _ownerItemsProperty: "decorationItems"});
310 this.decorationStoreManager.on("layoutInvalidated", lang.hitch(this, this._refreshDecorationItemsRendering));
311 this.decorationStoreManager.on("dataLoaded", lang.hitch(this, function(items){
312 this.set("decorationItems", items);
313 }));
314 },
315
316 buildRendering: function(){
317 this.inherited(arguments);
318 if(this.views == null || this.views.length == 0){
319 this.set("views", this._createDefaultViews());
320 }
321 },
322
323 _applyAttributes: function(){
324 this._applyAttr = true;
325 this.inherited(arguments);
326 delete this._applyAttr;
327 },
328
329 ////////////////////////////////////////////////////
330 //
331 // Getter / setters
332 //
333 ////////////////////////////////////////////////////
334
335 _setStartDateAttr: function(value){
336 this._set("startDate", value);
337 this._timeRangeInvalidated = true;
338 this._startDateChanged = true;
339 },
340
341 _setEndDateAttr: function(value){
342 this._set("endDate", value);
343 this._timeRangeInvalidated = true;
344 this._endDateChanged = true;
345 },
346
347 _setDateAttr: function(value){
348 this._set("date", value);
349 this._timeRangeInvalidated = true;
350 this._dateChanged = true;
351 },
352
353 _setDateIntervalAttr: function(value){
354 this._set("dateInterval", value);
355 this._timeRangeInvalidated = true;
356 },
357
358 _setDateIntervalStepsAttr: function(value){
359 this._set("dateIntervalSteps", value);
360 this._timeRangeInvalidated = true;
361 },
362
363 _setFirstDayOfWeekAttr: function(value){
364 this._set("firstDayOfWeek", value);
365 if(this.get("date") != null && this.get("dateInterval") == "week"){
366 this._timeRangeInvalidated = true;
367 }
368 },
369
370 _setTextDirAttr: function(value){
371 arr.forEach(this.views, function(view){
372 view.set("textDir", value);
373 });
374 },
375
376
377 ///////////////////////////////////////////////////
378 //
379 // Validating
380 //
381 ///////////////////////////////////////////////////
382
383 refreshRendering: function(){
384 // summary:
385 // Refreshes all the visual rendering of the calendar.
386 // tags:
387 // protected
388 this.inherited(arguments);
389 this._validateProperties();
390 },
391
392 _refreshItemsRendering: function(){
393 if(this.currentView){
394 this.currentView._refreshItemsRendering();
395 }
396 },
397
398 _updateRenderers: function(item){
399 if(this.currentView){
400 this.currentView.updateRenderers(item);
401 }
402 },
403
404 _refreshDecorationItemsRendering: function(){
405 if(this.currentView){
406 this.currentView._refreshDecorationItemsRendering();
407 }
408 },
409
410 resize: function(changeSize){
411 if(changeSize){
412 domGeometry.setMarginBox(this.domNode, changeSize);
413 }
414 if(this.currentView){
415 // must not pass the size, children are sized depending on the parent by CSS.
416 this.currentView.resize();
417 }
418 },
419
420 _validateProperties: function(){
421 // tags:
422 // private
423
424 var cal = this.dateModule;
425 var startDate = this.get("startDate");
426 var endDate = this.get("endDate");
427 var date = this.get("date");
428
429 if(this.firstDayOfWeek < -1 || this.firstDayOfWeek > 6){
430 this._set("firstDayOfWeek", 0);
431 }
432
433 var minDate = this.get("minDate");
434 var maxDate = this.get("maxDate");
435
436 if(minDate && maxDate){
437 if(cal.compare(minDate, maxDate) > 0){
438 var t = minDate;
439 this._set("minDate", maxDate);
440 this._set("maxDate", t);
441 }
442 }
443
444 if(date == null && (startDate != null || endDate != null)){
445
446 if(startDate == null){
447 startDate = new this.dateClassObj();
448 this._set("startDate", startDate);
449 this._timeRangeInvalidated = true;
450 }
451
452 if(endDate == null){
453 endDate = new this.dateClassObj();
454 this._set("endDate", endDate);
455 this._timeRangeInvalidated = true;
456 }
457
458 if(cal.compare(startDate, endDate) > 0){
459 endDate = cal.add(startDate, "day", 1);
460 this._set("endDate", endDate);
461 this._timeRangeInvalidated = true;
462 }
463
464 }else{
465
466 if(this.date == null){
467 this._set("date", new this.dateClassObj());
468 this._timeRangeInvalidated = true;
469 }
470
471 var dint = this.get("dateInterval");
472 if(dint != "day" && dint != "week" && dint != "month"){
473 this._set("dateInterval", "day");
474 this._timeRangeInvalidated = true;
475 }
476
477 var dis = this.get("dateIntervalSteps");
478 if(lang.isString(dis)){
479 dis = parseInt(dis);
480 this._set("dateIntervalSteps", dis);
481 }
482 if(dis <= 0) {
483 this.set("dateIntervalSteps", 1);
484 this._timeRangeInvalidated = true;
485 }
486 }
487
488 if(this._timeRangeInvalidated){
489 this._timeRangeInvalidated = false;
490
491 var timeInterval = this.computeTimeInterval();
492
493 if(this._timeInterval == null ||
494 cal.compare(this._timeInterval[0], timeInterval[0]) != 0 ||
495 cal.compare(this._timeInterval[1], timeInterval[1]) != 0){
496
497 if(this._dateChanged){
498 this._lastValidDate = this.get("date");;
499 this._dateChanged = false;
500 }else if(this._startDateChanged || this._endDateChanged){
501 this._lastValidStartDate = this.get("startDate");
502 this._lastValidEndDate = this.get("endDate");
503 this._startDateChanged = false;
504 this._endDateChanged = false;
505 }
506
507 this.onTimeIntervalChange({
508 oldStartTime: this._timeInterval == null ? null : this._timeInterval[0],
509 oldEndTime: this._timeInterval == null ? null : this._timeInterval[1],
510 startTime: timeInterval[0],
511 endTime: timeInterval[1]
512 });
513 }else{
514
515 if(this._dateChanged){
516 this._dateChanged = false;
517 if(this.lastValidDate != null){
518 this._set("date", this.lastValidDate);
519 }
520 }else if(this._startDateChanged || this._endDateChanged){
521 this._startDateChanged = false;
522 this._endDateChanged = false;
523 this._set("startDate", this._lastValidStartDate);
524 this._set("endDate", this._lastValidEndDate);
525 }
526 return;
527 }
528
529 this._timeInterval = timeInterval;
530
531 var duration = this.dateModule.difference(this._timeInterval[0], this._timeInterval[1], "day");
532 var view = this._computeCurrentView(timeInterval[0], timeInterval[1], duration);
533
534 var index = arr.indexOf(this.views, view);
535
536 if(view == null || index == -1){
537 return;
538 }
539
540 this._performViewTransition(view, index, timeInterval, duration);
541 }
542 },
543
544 _performViewTransition: function(view, index, timeInterval, duration){
545 var oldView = this.currentView;
546
547 if(this.animateRange && (!has("ie") || has("ie")>8) ){
548 if(oldView){ // there's a view to animate
549 oldView.beforeDeactivate();
550 var ltr = this.isLeftToRight();
551 var inLeft = this._animRangeInDir=="left" || this._animRangeInDir == null;
552 var outLeft = this._animRangeOutDir=="left" || this._animRangeOutDir == null;
553 this._animateRange(this.currentView.domNode, outLeft && ltr, false, 0, outLeft ? -100 : 100,
554 lang.hitch(this, function(){
555 oldView.afterDeactivate();
556 view.beforeActivate();
557 this.animateRangeTimer = setTimeout(lang.hitch(this, function(){
558 this._applyViewChange(view, index, timeInterval, duration);
559 this._animateRange(this.currentView.domNode, inLeft && ltr, true, inLeft ? -100 : 100, 0, function(){
560 view.afterActivate();
561 });
562 this._animRangeInDir = null;
563 this._animRangeOutDir = null;
564 }), 100); // setTimeout give time for layout of view.
565 }));
566 }else{
567 view.beforeActivate();
568 this._applyViewChange(view, index, timeInterval, duration);
569 view.afterActivate();
570 }
571 }else{
572 if(oldView){
573 oldView.beforeDeactivate();
574 }
575 view.beforeActivate();
576 this._applyViewChange(view, index, timeInterval, duration);
577 if(oldView){
578 oldView.afterDeactivate();
579 }
580 view.afterActivate();
581 }
582 },
583
584 onViewConfigurationChange: function(view){
585 // summary:
586 // Event dispatched when the view has been configured after the queried
587 // time range and before the current view is changed (if needed).
588 //
589 // view: ViewBase
590 // The view that has been configured.
591 // tags:
592 // callback
593 },
594
595 _applyViewChange: function(view, index, timeInterval, duration){
596 // summary:
597 // Applies the changes of a view time and changes the currently visible view if needed.
598 // view: ViewBase
599 // The view that is configured and is or will be shown.
600 // index: Integer
601 // The view index in the internal structure.
602 // timeInterval: Date[]
603 // The time interval displayed by the calendar.
604 // duration: Integer
605 // The duration in days of the time interval.
606 // tags:
607 // protected
608
609 this._configureView(view, index, timeInterval, duration);
610 this.onViewConfigurationChange(view);
611
612 if(index != this._currentViewIndex){
613 if(this.currentView == null){
614 view.set("items", this.items);
615 view.set("decorationItems", this.decorationItems);
616 this.set("currentView", view);
617 }else{
618 if(this.items == null || this.items.length == 0){
619 this.set("currentView", view);
620 if(this.animateRange && (!has("ie") || has("ie")>8) ){
621 domStyle.set(this.currentView.domNode, "opacity", 0);
622 }
623 view.set("items", this.items);
624 view.set("decorationItems", this.decorationItems);
625 }else{
626 this.currentView = view;
627 view.set("items", this.items);
628 view.set("decorationItems", this.decorationItems);
629 this.set("currentView", view);
630 if(this.animateRange && (!has("ie") || has("ie")>8) ){
631 domStyle.set(this.currentView.domNode, "opacity", 0);
632 }
633 }
634 }
635 }
636 },
637
638 _timeInterval: null,
639
640 computeTimeInterval: function(){
641
642 var d = this.get("date");
643 var minDate = this.get("minDate");
644 var maxDate = this.get("maxDate");
645 var cal = this.dateModule;
646
647 if(d == null){
648 var startDate = this.get("startDate");
649 var endDate = cal.add(this.get("endDate"), "day", 1);
650
651 if(minDate != null || maxDate != null){
652 var dur = this.dateModule.difference(startDate, endDate, "day");
653 if(cal.compare(minDate, startDate) > 0){
654 startDate = minDate;
655 endDate = cal.add(startDate, "day", dur);
656 }
657 if(cal.compare(maxDate, endDate) < 0){
658 endDate = maxDate;
659 startDate = cal.add(endDate, "day", -dur);
660 }
661 if(cal.compare(minDate, startDate) > 0){
662 startDate = minDate;
663 endDate = maxDate;
664 }
665 }
666 return [ this.floorToDay(startDate), this.floorToDay(endDate) ];
667
668 }else{
669
670 var interval = this._computeTimeIntervalImpl(d);
671
672 if(minDate != null){
673 var minInterval = this._computeTimeIntervalImpl(minDate);
674 if(cal.compare(minInterval[0], interval[0]) > 0){
675 interval = minInterval;
676 }
677 }
678
679 if(maxDate != null){
680 var maxInterval = this._computeTimeIntervalImpl(maxDate);
681 if(cal.compare(maxInterval[1], interval[1]) < 0){
682 interval = maxInterval;
683 }
684 }
685
686 return interval;
687 }
688 },
689
690 _computeTimeIntervalImpl: function(d){
691 // summary:
692 // Computes the displayed time interval according to the date, dateInterval and
693 // dateIntervalSteps if date is not null or startDate and endDate properties otherwise.
694 // tags:
695 // protected
696
697 var cal = this.dateModule;
698
699 var s = this.floorToDay(d);
700 var di = this.get("dateInterval");
701 var dis = this.get("dateIntervalSteps");
702 var e;
703
704 switch(di){
705 case "day":
706 e = cal.add(s, "day", dis);
707 break;
708 case "week":
709 s = this.floorToWeek(s);
710 e = cal.add(s, "week", dis);
711 break;
712 case "month":
713 s.setDate(1);
714 e = cal.add(s, "month", dis);
715 break;
716 default:
717 e = cal.add(s, "day", 1);
718 }
719 return [s, e];
720 },
721
722 onTimeIntervalChange: function(e){
723 // summary:
724 // Event dispatched when the displayed time interval has changed.
725 // e: __TimeIntervalChangeArgs
726 // The time interval change event.
727 // tags:
728 // callback
729 },
730
731 /////////////////////////////////////////////////////
732 //
733 // View Management
734 //
735 /////////////////////////////////////////////////////
736
737 // views: dojox.calendar.ViewBase[]
738 // The views displayed by the widget.
739 // To add/remove only one view, prefer, respectively, the addView() or removeView() methods.
740 views: null,
741
742 _setViewsAttr: function(views){
743 if(!this._applyAttr){
744 // 1/ in create() the constructor parameters are mixed in the widget
745 // 2/ in _applyAttributes(), every property with a setter is called.
746 // So no need to call on view removed for a non added view....
747 for(var i=0;i<this.views.length;i++){
748 this._onViewRemoved(this.views[i]);
749 }
750 }
751 if(views != null){
752 for(var i=0;i<views.length;i++){
753 this._onViewAdded(views[i]);
754 }
755 }
756 this._set("views", views == null ? [] : views.concat());
757 },
758
759 _getViewsAttr: function(){
760 return this.views.concat();
761 },
762
763 _createDefaultViews: function(){
764 // summary:
765 // Creates the default views.
766 // This method does nothing and is designed to be overridden.
767 // tags:
768 // protected
769 },
770
771 addView: function(view, index){
772 // summary:
773 // Add a view to the calendar's view list.
774 // view: dojox/calendar/ViewBase
775 // The view to add to the calendar.
776 // index: Integer
777 // Optional, the index where to insert the view in current view list.
778 // tags:
779 // protected
780
781 if(index <= 0 || index > this.views.length){
782 index = this.views.length;
783 }
784 this.views.splice(index, view);
785 this._onViewAdded(view);
786 },
787
788 removeView: function(view){
789 // summary:
790 // Removes a view from the calendar's view list.
791 // view: dojox/calendar/ViewBase
792 // The view to remove from the calendar.
793 // tags:
794 // protected
795
796 if(index < 0 || index >= this.views.length){
797 return;
798 }
799
800 this._onViewRemoved(this.views[index]);
801 this.views.splice(index, 1);
802 },
803
804 _onViewAdded: function(view){
805 view.owner = this;
806 view.buttonContainer = this.buttonContainer;
807 view._calendar = this._calendar;
808 view.datePackage = this.datePackage;
809 view.dateModule = this.dateModule;
810 view.dateClassObj = this.dateClassObj;
811 view.dateLocaleModule = this.dateLocaleModule;
812 domStyle.set(view.domNode, "display", "none");
813 domClass.add(view.domNode, "view");
814 domConstruct.place(view.domNode, this.viewContainer);
815 this.onViewAdded(view);
816 },
817
818 onViewAdded: function(view){
819 // summary:
820 // Event dispatched when a view is added from the calendar.
821 // view: dojox/calendar/ViewBase
822 // The view that has been added to the calendar.
823 // tags:
824 // callback
825
826 },
827
828 _onViewRemoved: function(view){
829 view.owner = null;
830 view.buttonContainer = null;
831 domClass.remove(view.domNode, "view");
832 this.viewContainer.removeChild(view.domNode);
833 this.onViewRemoved(view);
834 },
835
836 onViewRemoved: function(view){
837 // summary:
838 // Event dispatched when a view is removed from the calendar.
839 // view: dojox/calendar/ViewBase
840 // The view that has been removed from the calendar.
841 // tags:
842 // callback
843
844 },
845
846 _setCurrentViewAttr: function(view){
847 var index = arr.indexOf(this.views, view);
848 if(index != -1){
849 var oldView = this.get("currentView");
850 this._currentViewIndex = index;
851 this._set("currentView", view);
852
853 this._showView(oldView, view);
854 this.onCurrentViewChange({
855 oldView: oldView,
856 newView: view
857 });
858 }
859 },
860
861 _getCurrentViewAttr: function(){
862 return this.views[this._currentViewIndex];
863 },
864
865 onCurrentViewChange: function(e){
866 // summary:
867 // Event dispatched when the current view has changed.
868 // e: Event
869 // Object that contains the oldView and newView properties.
870 // tags:
871 // callback
872
873 },
874
875 _configureView: function(view, index, timeInterval, duration){
876 // summary:
877 // Configures the view to show the specified time interval.
878 // This method is computing and setting the following properties:
879 // - "startDate", "columnCount" for a column view,
880 // - "startDate", "columnCount", "rowCount", "refStartTime" and "refEndTime" for a matrix view.
881 // This method can be extended to configure other properties like layout properties for example.
882 // view: dojox/calendar/ViewBase
883 // The view to configure.
884 // index: Integer
885 // The index of the view in the Calendar view list.
886 // timeInterval: Date[]
887 // The time interval that will be displayed by the view.
888 // duration: Integer
889 // The duration, in days, of the displayed time interval.
890 // tags:
891 // protected
892
893 var cal = this.dateModule;
894 if(view.viewKind == "columns"){
895 view.set("startDate", timeInterval[0]);
896 view.set("columnCount", duration);
897 }else if(view.viewKind == "matrix"){
898 if(duration > 7){ // show only full weeks.
899 var s = this.floorToWeek(timeInterval[0]);
900 var e = this.floorToWeek(timeInterval[1]);
901 if(cal.compare(e, timeInterval[1]) != 0){
902 e = this.dateModule.add(e, "week", 1);
903 }
904 duration = this.dateModule.difference(s, e, "day");
905 view.set("startDate", s);
906 view.set("columnCount", 7);
907 view.set("rowCount", Math.ceil(duration/7));
908 view.set("refStartTime", timeInterval[0]);
909 view.set("refEndTime", timeInterval[1]);
910 }else{
911 view.set("startDate", timeInterval[0]);
912 view.set("columnCount", duration);
913 view.set("rowCount", 1);
914 view.set("refStartTime", null);
915 view.set("refEndTime", null);
916 }
917 }
918 },
919
920 _computeCurrentView: function(startDate, endDate, duration){
921 // summary:
922 // If the time range is lasting less than seven days returns the column view or the matrix view otherwise.
923 // startDate: Date
924 // The start date of the displayed time interval
925 // endDate: Date
926 // The end date of the displayed time interval
927 // duration: Integer
928 // Duration of the
929 // returns: dojox/calendar/ViewBase
930 // The view to display.
931 // tags:
932 // protected
933
934 return duration <= 7 ? this.columnView : this.matrixView;
935 },
936
937 matrixViewRowHeaderClick: function(e){
938 // summary:
939 // Function called when the cell of a row header of the matrix view is clicked.
940 // The implementation is doing the foolowing actions:
941 // - If another row is already expanded, collapse it and then expand the clicked row.
942 // - If the clicked row is already expadned, collapse it.
943 // - If no row is expanded, expand the click row.
944 // e: Object
945 // The row header click event.
946 // tags:
947 // protected
948
949 var expIndex = this.matrixView.getExpandedRowIndex();
950 if(expIndex == e.index){
951 this.matrixView.collapseRow();
952 }else if(expIndex == -1){
953 this.matrixView.expandRow(e.index);
954 }else{
955 var h = this.matrixView.on("expandAnimationEnd", lang.hitch(this, function(){
956 h.remove();
957 this.matrixView.expandRow(e.index);
958 }));
959 this.matrixView.collapseRow();
960 }
961 },
962
963 columnViewColumnHeaderClick: function(e){
964 // summary:
965 // Function called when the cell of a column header of the column view is clicked.
966 // Show the time range defined by the clicked date.
967 // e: Object
968 // The column header click event.
969 // tags:
970 // protected
971
972 var cal = this.dateModule;
973 if(cal.compare(e.date, this._timeInterval[0]) == 0 && this.dateInterval == "day" && this.dateIntervalSteps == 1){
974 this.set("dateInterval", "week");
975 }else{
976 this.set("date", e.date);
977 this.set("dateInterval", "day");
978 this.set("dateIntervalSteps", 1);
979 }
980 },
981
982 // viewFadeDuration: Integer
983 // The duration in milliseconds of the fade animation when the current view is changing.
984 viewChangeDuration: 0,
985
986 _showView: function(oldView, newView){
987 // summary:
988 // Displays the current view.
989 // oldView: dojox/calendar/ViewBase
990 // The previously displayed view or null.
991 // newView: dojox/calendar/ViewBase
992 // The view to display.
993 // tags:
994 // protected
995
996 if(oldView != null){
997 domStyle.set(oldView.domNode, "display", "none");
998 }
999 if(newView != null){
1000 domStyle.set(newView.domNode, "display", "block");
1001 newView.resize();
1002 if(!has("ie") || has("ie") > 7){
1003 domStyle.set(newView.domNode, "opacity", "1");
1004 }
1005 }
1006 },
1007
1008 ////////////////////////////////////////////////////
1009 //
1010 // Store & data
1011 //
1012 ////////////////////////////////////////////////////
1013
1014 _setItemsAttr: function(value){
1015 this._set("items", value);
1016 if(this.currentView){
1017 this.currentView.set("items", value);
1018 if(!this._isEditing){
1019 this.currentView.invalidateRendering();
1020 }
1021 }
1022 },
1023
1024 _setDecorationItemsAttr: function(value){
1025 this._set("decorationItems", value);
1026 if(this.currentView){
1027 this.currentView.set("decorationItems", value);
1028 this.currentView.invalidateRendering();
1029 }
1030 },
1031
1032 _setDecorationStoreAttr: function(value){
1033 this._set("decorationStore", value);
1034 this.decorationStore = value;
1035 this.decorationStoreManager.set("store", value);
1036 },
1037
1038 /////////////////////////////////////////////////////
1039 //
1040 // Time utilities
1041 //
1042 ////////////////////////////////////////////////////
1043
1044 floorToDay: function(date, reuse){
1045 // summary:
1046 // Floors the specified date to the start of day.
1047 // date: Date
1048 // The date to floor.
1049 // reuse: Boolean
1050 // Whether use the specified instance or create a new one. Default is false.
1051 // returns: Date
1052 return timeUtil.floorToDay(date, reuse, this.dateClassObj);
1053 },
1054
1055 floorToWeek: function(d){
1056 // summary:
1057 // Floors the specified date to the beginning of week.
1058 // date: Date
1059 // Date to floor.
1060 return timeUtil.floorToWeek(d, this.dateClassObj, this.dateModule, this.firstDayOfWeek, this.locale);
1061 },
1062
1063 newDate: function(obj){
1064 // summary:
1065 // Creates a new Date object.
1066 // obj: Object
1067 // This object can have several values:
1068 // - the time in milliseconds since gregorian epoch.
1069 // - a Date instance
1070 // returns: Date
1071 return timeUtil.newDate(obj, this.dateClassObj);
1072 },
1073
1074 isToday: function(date){
1075 // summary:
1076 // Returns whether the specified date is in the current day.
1077 // date: Date
1078 // The date to test.
1079 // renderData: Object
1080 // The current renderData
1081 // returns: Boolean
1082 return timeUtil.isToday(date, this.dateClassObj);
1083 },
1084
1085 isStartOfDay: function(d){
1086 // summary:
1087 // Tests if the specified date represents the starts of day.
1088 // d:Date
1089 // The date to test.
1090 // returns: Boolean
1091 return timeUtil.isStartOfDay(d, this.dateClassObj, this.dateModule);
1092 },
1093
1094 floorDate: function(date, unit, steps, reuse){
1095 // summary:
1096 // floors the date to the unit.
1097 // date: Date
1098 // The date/time to floor.
1099 // unit: String
1100 // The unit. Valid values are "minute", "hour", "day".
1101 // steps: Integer
1102 // For "day" only 1 is valid.
1103 // reuse: Boolean
1104 // Whether use the specified instance or create a new one. Default is false.
1105 // returns: Date
1106 return timeUtil.floor(date, unit, steps, reuse, this.classFuncObj);
1107 },
1108
1109 isOverlapping: function(renderData, start1, end1, start2, end2, includeLimits){
1110 // summary:
1111 // Computes if the first time range defined by the start1 and end1 parameters
1112 // is overlapping the second time range defined by the start2 and end2 parameters.
1113 // renderData: Object
1114 // The render data.
1115 // start1: Date
1116 // The start time of the first time range.
1117 // end1: Date
1118 // The end time of the first time range.
1119 // start2: Date
1120 // The start time of the second time range.
1121 // end2: Date
1122 // The end time of the second time range.
1123 // includeLimits: Boolean
1124 // Whether include the end time or not.
1125 // returns: Boolean
1126 return timeUtil.isOverlapping(renderData, start1, end1, start2, end2, includeLimits);
1127 },
1128
1129 /////////////////////////////////////////////////////
1130 //
1131 // Time navigation
1132 //
1133 ////////////////////////////////////////////////////
1134
1135
1136 // animateRange: Boolean
1137 // Indicates that the previous/next range method will be animated.
1138 animateRange: true,
1139
1140 // animationRangeDuration: Integer
1141 // The duration of the next/previous range animation.
1142 animationRangeDuration: 400,
1143
1144 _animateRange : function(node, toLeft, fadeIn, xFrom, xTo, onEnd){
1145 // summary:
1146 // Animates the current view using a synchronous fade and horizontal translation.
1147 // toLeft: Boolean
1148 // Whether the view is moved to the left or to the right.
1149 // fadeIn: Boolean
1150 // Whether the view is faded in or out.
1151 // xFrom: Integer
1152 // Position before the animation
1153 // xTo: Integer
1154 // Position after the animation
1155 // onEnd: Function
1156 // Function called when the animation is finished.
1157 // tags:
1158 // protected
1159
1160
1161 if(this.animateRangeTimer){ // cleanup previous call not finished
1162 clearTimeout(this.animateRangeTimer);
1163 delete this.animateRangeTimer;
1164 }
1165
1166 var fadeFunc = fadeIn ? coreFx.fadeIn : coreFx.fadeOut;
1167 domStyle.set(node, {left: xFrom + "px", right: (-xFrom) + "px"});
1168
1169 fx.combine([
1170 coreFx.animateProperty({
1171 node: node,
1172 properties: {left: xTo, right: -xTo},
1173 duration: this.animationRangeDuration/2,
1174 onEnd: onEnd
1175 }),
1176 fadeFunc({node: node, duration: this.animationRangeDuration/2})
1177 ]).play();
1178 },
1179
1180 // _animRangeOutDir: Boolean
1181 // Direction of the range animation when the view 'leaving' the screen.
1182 // Valid values are:
1183 // - null: auto value,
1184 // - "left": hides to left side (right in right to left).
1185 // - "right": hides to right side (left in right to left).
1186 _animRangeOutDir: null,
1187
1188 // _animRangeInDir: Boolean
1189 // Direction of the range animation when the view 'entering' the screen.
1190 // Valid values are:
1191 // - null: auto value,
1192 // - "left": shows from left side (right in right to left).
1193 // - "right": shows from right side (left in right to left).
1194 _animRangeOutDir: null,
1195
1196 nextRange: function(){
1197 this._animRangeOutDir = "left";
1198 this._animRangeInDir = "right";
1199 this._navigate(1);
1200 },
1201
1202 previousRange: function(){
1203 this._animRangeOutDir = "right";
1204 this._animRangeInDir = "left";
1205 this._navigate(-1);
1206 },
1207
1208 _navigate: function(dir){
1209 // tags:
1210 // private
1211
1212 var d = this.get("date");
1213 var cal = this.dateModule;
1214
1215 if(d == null){
1216 var s = this.get("startDate");
1217 var e = this.get("endDate");
1218 var dur = cal.difference(s, e, "day");
1219 if(dir == 1){
1220 e = cal.add(e, "day", 1);
1221 this.set("startDate", e);
1222 this.set("endDate", cal.add(e, "day", dur));
1223 }else{
1224 s = cal.add(s, "day", -1);
1225 this.set("startDate", cal.add(s, "day", -dur));
1226 this.set("endDate", s);
1227 }
1228 }else{
1229 var di = this.get("dateInterval");
1230 var dis = this.get("dateIntervalSteps");
1231 this.set("date", cal.add(d, di, dir * dis));
1232 }
1233 },
1234
1235 goToday: function(){
1236 // summary:
1237 // Changes the displayed time interval to show the current day.
1238 // Sets the date property to the current day, the dateInterval property to "day" and
1239 // the "dateIntervalSteps" to 1.
1240 this.set("date", this.floorToDay(new this.dateClassObj(), true));
1241 this.set("dateInterval", "day");
1242 this.set("dateIntervalSteps", 1);
1243 },
1244
1245 ////////////////////////////////////////////////////
1246 //
1247 // Buttons
1248 //
1249 ////////////////////////////////////////////////////
1250
1251 postCreate: function(){
1252 this.inherited(arguments);
1253 this.configureButtons();
1254 },
1255
1256 configureButtons: function(){
1257 // summary:
1258 // Set the localized labels of the buttons and the event handlers.
1259 // tags:
1260 // protected
1261
1262 var rtl = !this.isLeftToRight();
1263
1264 if(this.previousButton){
1265 this.previousButton.set("label", _nls[rtl?"nextButton":"previousButton"]);
1266 this.own(
1267 on(this.previousButton, "click", lang.hitch(this, this.previousRange))
1268 );
1269 }
1270
1271 if(this.nextButton){
1272 this.nextButton.set("label", _nls[rtl?"previousButton":"nextButton"]);
1273 this.own(
1274 on(this.nextButton, "click", lang.hitch(this, this.nextRange))
1275 );
1276 }
1277
1278 if(rtl && this.previousButton && this.nextButton){
1279 var t = this.previousButton;
1280 this.previousButton = this.nextButton;
1281 this.nextButton = t;
1282 }
1283
1284 if(this.todayButton){
1285 this.todayButton.set("label", _nls.todayButton);
1286 this.own(
1287 on(this.todayButton, "click", lang.hitch(this, this.todayButtonClick))
1288 );
1289 }
1290
1291 if(this.dayButton){
1292 this.dayButton.set("label", _nls.dayButton);
1293 this.own(
1294 on(this.dayButton, "click", lang.hitch(this, this.dayButtonClick))
1295 );
1296 }
1297
1298 if(this.weekButton){
1299 this.weekButton.set("label", _nls.weekButton);
1300 this.own(
1301 on(this.weekButton, "click", lang.hitch(this, this.weekButtonClick))
1302 );
1303 }
1304
1305 if(this.fourDaysButton){
1306 this.fourDaysButton.set("label", _nls.fourDaysButton);
1307 this.own(
1308 on(this.fourDaysButton, "click", lang.hitch(this, this.fourDaysButtonClick))
1309 );
1310 }
1311
1312 if(this.monthButton){
1313 this.monthButton.set("label", _nls.monthButton);
1314 this.own(
1315 on(this.monthButton, "click", lang.hitch(this, this.monthButtonClick))
1316 );
1317 }
1318 },
1319
1320 todayButtonClick: function(e){
1321 // summary:
1322 // The action triggered when the today button is clicked.
1323 // By default, calls the goToday() method.
1324
1325 this.goToday();
1326 },
1327 dayButtonClick: function(e){
1328 // summary:
1329 // The action triggerred when the day button is clicked.
1330 // By default, sets the dateInterval property to "day" and
1331 // the "dateIntervalSteps" to 1.
1332
1333 if(this.get("date") == null){
1334 this.set("date", this.floorToDay(new this.dateClassObj(), true));
1335 }
1336 this.set("dateInterval", "day");
1337 this.set("dateIntervalSteps", 1);
1338 },
1339
1340 weekButtonClick: function(e){
1341 // summary:
1342 // The action triggered when the week button is clicked.
1343 // By default, sets the dateInterval property to "week" and
1344 // the "dateIntervalSteps" to 1.
1345 this.set("dateInterval", "week");
1346 this.set("dateIntervalSteps", 1);
1347 },
1348 fourDaysButtonClick: function(e){
1349 // summary:
1350 // The action triggerred when the 4 days button is clicked.
1351 // By default, sets the dateInterval property to "day" and
1352 // the "dateIntervalSteps" to 4.
1353 this.set("dateInterval", "day");
1354 this.set("dateIntervalSteps", 4);
1355 },
1356 monthButtonClick: function(e){
1357 // summary:
1358 // The action triggered when the month button is clicked.
1359 // By default, sets the dateInterval property to "month" and
1360 // the "dateIntervalSteps" to 1.
1361 this.set("dateInterval", "month");
1362 this.set("dateIntervalSteps", 1);
1363 },
1364
1365 /////////////////////////////////////////////////////
1366 //
1367 // States item
1368 //
1369 ////////////////////////////////////////////////////
1370
1371 updateRenderers: function(obj, stateOnly){
1372 if(this.currentView){
1373 this.currentView.updateRenderers(obj, stateOnly);
1374 }
1375 },
1376
1377 getIdentity: function(item){
1378 return item ? item.id : null;
1379 },
1380
1381 _setHoveredItem: function(item, renderer){
1382 if(this.hoveredItem && item && this.hoveredItem.id != item.id ||
1383 item == null || this.hoveredItem == null){
1384 var old = this.hoveredItem;
1385 this.hoveredItem = item;
1386
1387 this.updateRenderers([old, this.hoveredItem], true);
1388
1389 if(item && renderer){
1390 this.currentView._updateEditingCapabilities(item._item ? item._item : item, renderer);
1391 }
1392 }
1393 },
1394
1395 // hoveredItem: Object
1396 // Current render item which is under the mouse cursor.
1397 hoveredItem: null,
1398
1399 isItemHovered: function(item){
1400 // summary:
1401 // Returns whether the specified item is hovered or not.
1402 // item: Object
1403 // The item.
1404 // returns: Boolean
1405 return this.hoveredItem != null && this.hoveredItem.id == item.id;
1406 },
1407
1408 ////////////////////////////////////////////////////////////////////////
1409 //
1410 // Editing
1411 //
1412 ////////////////////////////////////////////////////////////////////////
1413
1414 isItemEditable: function(item, rendererKind){
1415 // summary:
1416 // Computes whether particular item renderer can be edited.
1417 // By default it is using the editable property value.
1418 // item: Object
1419 // The data item represented by the renderer.
1420 // rendererKind: String
1421 // The kind of renderer.
1422 // returns: Boolean
1423 return this.editable;
1424 },
1425
1426 isItemMoveEnabled: function(item, rendererKind){
1427 // summary:
1428 // Computes whether particular item renderer can be moved.
1429 // By default it is using the moveEnabled property value.
1430 // item: Object
1431 // The data item represented by the renderer.
1432 // rendererKind: String
1433 // The kind of renderer.
1434 // returns: Boolean
1435 return this.isItemEditable(item, rendererKind) && this.moveEnabled;
1436 },
1437
1438 isItemResizeEnabled: function(item, rendererKind){
1439 // summary:
1440 // Computes whether particular item renderer can be resized.
1441 // By default it is using the resizedEnabled property value.
1442 // item: Object
1443 // The data item represented by the renderer.
1444 // rendererKind: String
1445 // The kind of renderer.
1446 // returns: Boolean
1447
1448 return this.isItemEditable(item, rendererKind) && this.resizeEnabled;
1449 },
1450
1451
1452 ////////////////////////////////////////////////////////////////////////
1453 //
1454 // Widget events
1455 //
1456 ////////////////////////////////////////////////////////////////////////
1457
1458 onGridClick: function(e){
1459 // summary:
1460 // Event dispatched when the grid has been clicked.
1461 // e: __GridClickEventArgs
1462 // The event dispatched when the grid is clicked.
1463 // tags:
1464 // callback
1465
1466 },
1467
1468 onGridDoubleClick: function(e){
1469 // summary:
1470 // Event dispatched when the grid has been double-clicked.
1471 // e: __GridClickEventArgs
1472 // The event dispatched when the grid is double-clicked.
1473 // tags:
1474 // callback
1475 },
1476
1477 onItemClick: function(e){
1478 // summary:
1479 // Event dispatched when an item renderer has been clicked.
1480 // e: __ItemMouseEventArgs
1481 // The event dispatched when an item is clicked.
1482 // tags:
1483 // callback
1484 },
1485
1486 onItemDoubleClick: function(e){
1487 // summary:
1488 // Event dispatched when an item renderer has been double-clicked.
1489 // e: __ItemMouseEventArgs
1490 // The event dispatched when an item is double-clicked.
1491 // tags:
1492 // callback
1493 },
1494
1495 onItemContextMenu: function(e){
1496 // summary:
1497 // Event dispatched when an item renderer has been context-clicked.
1498 // e: __ItemMouseEventArgs
1499 // The event dispatched when an item is context-clicked.
1500 // tags:
1501 // callback
1502 },
1503
1504 onItemEditBegin: function(e){
1505 // summary:
1506 // Event dispatched when the item is entering the editing mode.
1507 // e: __itemEditingEventArgs
1508 // The editing event.
1509 // tags:
1510 // callback
1511 },
1512
1513 onItemEditEnd: function(e){
1514 // summary:
1515 // Event dispatched when the item is leaving the editing mode.
1516 // e: __itemEditingEventArgs
1517 // The editing event.
1518 // tags:
1519 // callback
1520 },
1521
1522 onItemEditBeginGesture: function(e){
1523 // summary:
1524 // Event dispatched when an editing gesture is beginning.
1525 // e: __itemEditingEventArgs
1526 // The editing event.
1527 // tags:
1528 // callback
1529 },
1530
1531 onItemEditMoveGesture: function(e){
1532 // summary:
1533 // Event dispatched during a move editing gesture.
1534 // e: __itemEditingEventArgs
1535 // The editing event.
1536 // tags:
1537 // callback
1538 },
1539
1540 onItemEditResizeGesture: function(e){
1541 // summary:
1542 // Event dispatched during a resize editing gesture.
1543 // e: __itemEditingEventArgs
1544 // The editing event.
1545 // tags:
1546 // callback
1547 },
1548
1549 onItemEditEndGesture: function(e){
1550 // summary:
1551 // Event dispatched at the end of an editing gesture.
1552 // e: __itemEditingEventArgs
1553 // The editing event.
1554 // tags:
1555 // callback
1556 },
1557
1558 onItemRollOver: function(e){
1559 // Summary:
1560 // Event dispatched when the mouse cursor in going over an item renderer.
1561 // e: __ItemMouseEventArgs
1562 // The event dispatched when the mouse cursor enters in the item renderer.
1563 // tags:
1564 // callback
1565 },
1566
1567 onItemRollOut: function(e){
1568 // Summary:
1569 // Event dispatched when the mouse cursor in leaving an item renderer.
1570 // e: __ItemMouseEventArgs
1571 // The event dispatched when the mouse cursor enters in the item renderer.
1572 // tags:
1573 // callback
1574 },
1575
1576 onColumnHeaderClick: function(e){
1577 // summary:
1578 // Event dispatched when a column header cell is dispatched.
1579 // e: __HeaderClickEventArgs
1580 // Header click event.
1581 // tags:
1582 // callback
1583 },
1584
1585 onRowHeaderClick: function(e){
1586 // summary:
1587 // Event dispatched when a row header cell is clicked.
1588 // e: __HeaderClickEventArgs
1589 // Header click event.
1590 // tags:
1591 // callback
1592 },
1593
1594 onExpandRendererClick: function(e){
1595 // summary:
1596 // Event dispatched when an expand renderer is clicked.
1597 // e: __ExpandRendererClickEventArgs
1598 // Expand renderer click event.
1599 // tags:
1600 // callback
1601 },
1602
1603 _onRendererCreated: function(e){
1604 this.onRendererCreated(e);
1605 },
1606
1607 onRendererCreated: function(e){
1608 // summary:
1609 // Event dispatched when an item renderer has been created.
1610 // e: __rendererLifecycleEventArgs
1611 // The renderer lifecycle event.
1612 // tags:
1613 // callback
1614 },
1615
1616 _onRendererRecycled: function(e){
1617 this.onRendererRecycled(e);
1618 },
1619
1620 onRendererRecycled: function(e){
1621 // summary:
1622 // Event dispatched when an item renderer has been recycled.
1623 // e: __rendererLifecycleEventArgs
1624 // The renderer lifecycle event.
1625 // tags:
1626 // callback
1627 },
1628
1629 _onRendererReused: function(e){
1630 this.onRendererReused(e);
1631 },
1632
1633 onRendererReused: function(e){
1634 // summary:
1635 // Event dispatched when an item renderer that was recycled is reused.
1636 // e: __rendererLifecycleEventArgs
1637 // The renderer lifecycle event.
1638 // tags:
1639 // callback
1640 },
1641
1642 _onRendererDestroyed: function(e){
1643 this.onRendererDestroyed(e);
1644 },
1645
1646 onRendererDestroyed: function(e){
1647 // summary:
1648 // Event dispatched when an item renderer is destroyed.
1649 // e: __rendererLifecycleEventArgs
1650 // The renderer lifecycle event.
1651 // tags:
1652 // callback
1653 },
1654
1655 _onRenderersLayoutDone: function(view){
1656 this.onRenderersLayoutDone(view);
1657 },
1658
1659 onRenderersLayoutDone: function(view){
1660 // summary:
1661 // Event triggered when item renderers layout has been done.
1662 // view: dojox/calendar/ViewBase
1663 // The view that has been laid-out.
1664 // tags:
1665 // callback
1666 }
1667
1668 });
1669 });