BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
<ScheduleComponentOn screen entry, they see the monhly view based on the data returned from the db. When switching views, the following occurs in the onActionComplete function (whether or not that should be moved is still something I am exploring):
actionBegin={(args) => this.onActionBegin(args)}
actionComplete={(args) => this.onActionComplete(args, data, AppointmentData)}
currentView={this.state.currentView}
eventSettings={{dataSource: data}}
height='750px'
id='job-schedule'
navigating={(args) => this.onNavigation(args)}
quickInfoTemplates={{content: (props) => this.renderQuickInfoBody(props)}}
readonly
ref={t => (this.scheduleObj = t)}
renderCell={(args) => this.renderResourceHeader(args)}
resourceHeaderTemplate={(props) => this.renderResourceData(props)}
selectedDate={this.state.selectedDate}>
<ViewsDirective>
<ViewDirective option='Agenda' />
<ViewDirective option='Month' />
<ViewDirective option='TimelineWeek' interval={1} />
<ViewDirective option='TimelineDay' interval={1} />
</ViewsDirective>
<ResourcesDirective id='job-schedule-resources'>
<ResourceDirective
allowMultiple
dataSource={jobData}
field='JobId'
idField='Id'
name='Jobs'
textField='Subject'
title='Job' />
<ResourceDirective
allowMultiple
dataSource={workerData}
field='WorkerId'
groupIDField='JobId'
idField='WorkerId'
name='Workers'
title='Worker' />
<ResourceDirective
allowMultiple
colorField='Color'
field='AppointmentId'
idField='Id'
name='Appointments'
title='Appointment' />
<ResourceDirective
allowMultiple={false}
colorField='Color'
dataSource={data}
field='Id'
idField='Id'
name='Events'
textField='OwnerText'
title='Event' />
</ResourcesDirective>
<Inject services={[Agenda, Month, TimelineViews]} />
</ScheduleComponent>
onActionComplete = (args, data, AppointmentData) => {
let {activeFilters, filters, onFilterChange} = this.props
let filterState = {}
const schedule = document.getElementById('job-schedule')
if (args.requestType === 'viewNavigate') {
if (this.scheduleObj.currentView === 'Agenda') {
this.scheduleObj.height = '750px'
this.scheduleObj.eventSettings = {dataSource: data, resourceColorField: 'Shifts'}
this.scheduleObj.enableTooltip = false
this.scheduleObj.group = {enableCompactView: true, resources: []}
this.scheduleObj.firstDayOfWeek = 0
}
if (this.scheduleObj.currentView === 'Month') {
this.scheduleObj.height = '750px'
this.scheduleObj.eventSettings = {dataSource: data, resourceColorField: 'Shifts'}
this.scheduleObj.enableTooltip = true
this.scheduleObj.group = {enableCompactView: true, resources: []}
this.scheduleObj.firstDayOfWeek = 0
}
if (this.scheduleObj.currentView === 'TimelineWeek') {
const startDate = this.scheduleObj.activeView.renderDates.find(x => x.getDay() === today.getDay())
let endDate = new Date()
endDate.setDate(startDate.getDate() + 7)
activeFilters.dateRangeFrom = {
name: `Date From: ${moment(startDate).format('L')}`,
type: 'dateRangeFrom',
value: moment(startDate).format('L')
}
activeFilters.dateRangeTo = {
name: `Date To: ${moment(endDate).format('L')}`,
type: 'dateRangeTo',
value: moment(endDate).endOf('day')
}
filters.shiftStartDateTime = {ge: startDate, le: endDate}
filterState.filters = filters
filterState.activeFilters = activeFilters
onFilterChange(filterState)
this.scheduleObj.height = 'auto'
this.scheduleObj.eventSettings = {dataSource: AppointmentData, resourceColorField: 'Appointments'}
this.scheduleObj.group = {enableCompactView: true, resources: ['Jobs', 'FloatPoolMembers']}
this.scheduleObj.enableTooltip = true
this.scheduleObj.timeScale = {enable: true, interval: 480, slotCount: 3}
this.scheduleObj.firstDayOfWeek = today.getDay()
}
if (this.scheduleObj.currentView === 'TimelineDay') {
this.scheduleObj.height = 'auto'
this.scheduleObj.eventSettings = {dataSource: AppointmentData, resourceColorField: 'Appointments'}
this.scheduleObj.group = {enableCompactView: true, resources: ['Jobs', 'Workers']}
this.scheduleObj.enableTooltip = true
this.scheduleObj.timeScale = {enable: true, interval: 60, slotCount: 2}
}
} else if (args.requestType === 'toolBarItemRendered') {
let createJobElement = schedule.querySelector('.e-toolbar-btn')
createJobElement.onclick = () => { this.onCreateJobClick() }
}
}
<ResourcesDirective id='job-schedule-resources'>
<ResourceDirective
allowMultiple
dataSource={this.jobData}
field='JobId'
idField='Id'
name='Jobs'
textField='Subject'
title='Job'
colorField='color' />
<ResourceDirective
allowMultiple
dataSource={this.workerData}
field='WorkerId'
textField='Subject'
groupIDField='JobId'
idField='WorkerId'
name='Workers'
title='Worker'
colorField='color' />
<ResourceDirective
dataSource={this.Appoint}
allowMultiple
colorField='Color'
field='AppointmentId'
textField='Subject'
idField='Id'
name='Appointments'
title='Appointment' />
<ResourceDirective
allowMultiple={false}
colorField='Color'
dataSource={this.events}
field='Id'
idField='Id'
name='Events'
textField='OwnerText'
title='Event' />
</ResourcesDirective>
|
this.scheduleObj.group = {enableCompactView: true, resources: ['Jobs', 'Workers']}
allowMultiple
dataSource={jobData}
field='JobId'
idField='Id'
name='Jobs'
textField='Subject'
title='Job' />
allowMultiple
dataSource={workerData}
field='WorkerId'
groupIDField='JobId'
idField='WorkerId'
name='Workers'
title='Worker' />
allowMultiple
colorField='Color' dataSource={appointmentData}
field='AppointmentId'
idField='Id'
name='Appointments' textField='Subject'
title='Appointment' />
this.scheduleObj.height = 'auto'
this.scheduleObj.eventSettings = {dataSource: appointmentData, resourceColorField: 'Appointments'}
this.scheduleObj.group = {enableCompactView: true, resources: ['Jobs', 'Workers']}
this.scheduleObj.enableTooltip = true
this.scheduleObj.timeScale = {enable: true, interval: 480, slotCount: 3}
const appointmentData = [{
Color: '#FF0000',
EndTime: '2019-06-09T18:00:00Z',
Worker: 'Open',
Id: 1020,
JobId: 9,
StartTime: '2019-06-09T10:00:00Z',
Subject: '06/09/2019'
},
{
Color: '#FF8C00',
EndTime: '2019-06-08T18:00:00Z',
Worker: 'Open',
Id: 1019,
JobId: 9,
StartTime: '2019-06-08T10:00:00Z',
Subject: '06/08/2019'},
{
Color: '#92bdd5',
EndTime: '2019-06-07T00:00:00Z',
WorkerId: 378875,
Id: 13,
JobId: 9,
StartTime: '2019-06-06T12:00:00Z',
Subject: '06/06/2019'
}]
const workerData = [{
Agency: '',
Worker: 'Open',
WorkerId: '9-0',
JobId: 9
}, {
Agency: 'Agency 1',
Worker: 'Johnny Gargano',
WorkerId: 378875,
JobId: 3
}]
const jobData = [{
Id: 9,
Subject: 'Job #9'
}]