JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Window › Scheduler Resource › Reply To: Scheduler Resource
June 30, 2021 at 1:58 pm
#101958
Member
Hi kboughaba,
It will be best to share a bit more context of the use case of the Type error you are getting – the best is to create a code example which reproduces is in order to be able to give you a solution about it.
For the question before, take my apologies for missing it.
You have to define in the projectId in Scheduler in the SchedulerDataSource like so-
dataSource: SchedulerDataSource[] = (() => {
const today = new Date(),
currentYear = today.getFullYear(),
currentMonth = today.getMonth(),
currentDate = today.getDate(),
data = [
{
label: 'Prescribe and/or administer treatment and medication',
doctorId: 3,
dateStart: new Date(currentYear, currentMonth, currentDate + 3, 9, 20),
dateEnd: new Date(currentYear, currentMonth, currentDate + 3, 10, 35)
},
{
label: 'Monitor the cognitive side effects of medication',
doctorId: 3,
dateStart: new Date(currentYear, currentMonth, currentDate + 4, 10, 20),
dateEnd: new Date(currentYear, currentMonth, currentDate + 4, 13)
},
{
label: '1111111Order supportive care services for patients',
projectId: 2,
dateStart: new Date(currentYear, currentMonth, currentDate - 4, 9),
dateEnd: new Date(currentYear, currentMonth, currentDate - 4, 11, 15)
},
{
label: '222222Participate in neuroscience research activities',
projectId: 1,
dateStart: new Date(currentYear, currentMonth, currentDate - 3, 9),
dateEnd: new Date(currentYear, currentMonth, currentDate - 3, 11, 15)
}]
And then you can use it in the SchedulerResource like so:
resources: SchedulerResource[] = [
{
label: 'Project',
value: 'projectId',
dataSource: [
{
label: 'Projet1',
id:1
},
{
label: 'Projet2',
id: 2
}
]
}
];
Please, do not hesitate to contact us if you have any additional questions.
Best regards,
Yavor Dashev
Smart UI Team
https://www.htmlelements.com/