mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-06-27 16:10:13 +08:00
Resources added
This commit is contained in:
@@ -40,6 +40,7 @@ function generateAgendaTimeFormat(options, langData) {
|
||||
|
||||
|
||||
function HAgendaView(calendar) {
|
||||
debugger;
|
||||
View.call(this, calendar); // call the super-constructor
|
||||
|
||||
this.timeGrid = new HTimeGrid(this);
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
----------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
function HResourceTimeGrid(view) {
|
||||
TimeGrid.call(this, view); // call the super-constructor
|
||||
HTimeGrid.call(this, view); // call the super-constructor
|
||||
}
|
||||
|
||||
|
||||
HResourceTimeGrid.prototype = createObject(TimeGrid.prototype); // define the super-class
|
||||
HResourceTimeGrid.prototype = createObject(HTimeGrid.prototype); // define the super-class
|
||||
$.extend(HResourceTimeGrid.prototype, {
|
||||
// Slices up a date range into a segment for each column
|
||||
// Each column represents a resource. An event can be assigned to multiple resources
|
||||
|
||||
@@ -66,7 +66,6 @@ $.extend(HTimeGrid.prototype, {
|
||||
|
||||
// Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL.
|
||||
slatRowHtml: function() {
|
||||
debugger;
|
||||
var view = this.view;
|
||||
var calendar = view.calendar;
|
||||
var isRTL = view.opt('isRTL');
|
||||
@@ -77,16 +76,15 @@ $.extend(HTimeGrid.prototype, {
|
||||
var minutes;
|
||||
var axisHtml;
|
||||
|
||||
// Calculate the time for each slot
|
||||
while (slotTime < this.maxTime) {
|
||||
slotDate = view.start.clone().time(slotTime); // will be in UTC but that's good. to avoid DST issues
|
||||
minutes = slotDate.minutes();
|
||||
var resources = calendar.fetchResources();
|
||||
|
||||
for(var i = 0; i < resources.length - 1; i++){
|
||||
axisHtml =
|
||||
'<td class="fc-axis fc-time ' + view.widgetContentClass + '" ' + view.axisStyleAttr() + '>' +
|
||||
((!slotNormal || !minutes) ? // if irregular slot duration, or on the hour, then display the time
|
||||
'<span>' + // for matchCellWidths
|
||||
htmlEscape(calendar.formatDate(slotDate, view.opt('axisFormat'))) +
|
||||
//htmlEscape(calendar.formatDate(slotDate, view.opt('axisFormat'))) +
|
||||
resources[i].name +
|
||||
'</span>' :
|
||||
''
|
||||
) +
|
||||
@@ -98,8 +96,6 @@ $.extend(HTimeGrid.prototype, {
|
||||
'<td class="' + view.widgetContentClass + '"/>' +
|
||||
(isRTL ? axisHtml : '') +
|
||||
"</tr>";
|
||||
|
||||
slotTime.add(this.slotDuration);
|
||||
}
|
||||
|
||||
return html;
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
<script src='../src/resource/ResourceView.js'></script>
|
||||
<script src='../src/resource/ResourceDayView.js'></script>
|
||||
|
||||
<script src='../src/resource/gantt/HResourceTimeGrid.js'></script>
|
||||
<script src='../src/resource/gantt/HTimeGrid.js'></script>
|
||||
<script src='../src/resource/gantt/HResourceTimeGrid.js'></script>
|
||||
<script src='../src/resource/gantt/HAgendaView.js'></script>
|
||||
<script src='../src/resource/gantt/HResourceView.js'></script>
|
||||
<script src='../src/resource/gantt/HResourceDayView.js'></script>
|
||||
@@ -71,7 +71,7 @@
|
||||
center: 'title',
|
||||
right: 'agendaDay,resourceDay'
|
||||
},
|
||||
defaultView: 'resourceDay',
|
||||
defaultView: 'hResourceDay',
|
||||
resources: [
|
||||
{ 'id': 'resource1', 'name': 'Resource 1', 'className': 'css-class-as-string' },
|
||||
{ 'id': 'resource2', 'name': 'Resource 2', 'className': ['green', 'another-css-class-name'] },
|
||||
|
||||
Reference in New Issue
Block a user