jqwidgets / jQWidgets

Angular, Vue, React, Web Components, Blazor, Javascript, jQuery and ASP .NET Framework,
https://www.jqwidgets.com/
304 stars 135 forks source link

jqxScheduler - the "addAppointment" method does not add appropriate appointments depending on the "Room" #72

Closed jqwidgets closed 5 years ago

jqwidgets commented 5 years ago

Add more than one appointment from different "Rooms".

Example: http://jsfiddle.net/n9ag4zmo/

jqwidgets commented 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'
                ]
            });