Closed jqwidgets closed 5 years ago
The resources should be initialized like that:
$("#scheduler").jqxScheduler({
date: new $.jqx.date(2017, 11, 23),
width: 750,
height: 600,
source: adapter,
view: 'weekView',
showLegend: true,
ready: function () {
$("#scheduler").jqxScheduler('ensureAppointmentVisible', 'id6');
},
resources:
{
colorScheme: "scheme05",
dataField: "calendar",
source: new $.jqx.dataAdapter(
{
dataType: "array",
dataFields: [
{ name: 'id', type: 'string' },
{ name: 'description', type: 'string' },
{ name: 'location', type: 'string' },
{ name: 'subject', type: 'string' },
{ name: 'calendar', type: 'string' },
{ name: 'start', type: 'date' },
{ name: 'end', type: 'date' }
],
id: 'id',
localData: [
{ calendar: 'Room 1' },
{ calendar: 'Room 2' },
{ calendar: 'Room 3' },
{ calendar: 'Room 4' }
]
})
},
appointmentDataFields:
{
from: "start",
to: "end",
id: "id",
description: "description",
location: "location",
subject: "subject",
resourceId: "calendar"
},
views:
[
'dayView',
'weekView',
'monthView'
]
});
Add more than one appointment from different "Rooms".
Example: http://jsfiddle.net/n9ag4zmo/