Discuss anything related to web development but no technical support questions


Post by odedg »

Ok, understood.

Arcady, I have changed as you said the json build of the calendars to be the same as the task store.
Yet, getting the same error.

I am re-sending the test case.

Please advise.

Post by Maxim Gorkovsky »

Hello.
I checked your latest test case, looks ok for me. I also tried to load your calendars data into our advanced example to inspect tree structure in calendar window, hierarchy is ok there too. So what is the error you are talking about? I see first post in this thread where you get wrong parent and I cannot see this locally.
parent is present
parent is present
cal.PNG (12.46 KiB) Viewed 4333 times

Post by odedglas »

Hey, Problem is as follow :

Image

Parent is set, correct but still this error occurs.

Post by Maxim Gorkovsky »

That error message means that your calendars do not have any working periods, described by defaultAvailability config. You pass empty array there, you should pass at least one working period (or leave empty for default value)

Post by odedglas »

Hey,
I'm a bit confused due to your answer Maxim.

As defined in your guides :
"A child calendar will "inherit" the following configurations from its parent: "day overrides", "week days", "week day overrides" and even defaultAvailability/weekendsAreWorkdays configs. Any child calendar days defined on the same dates as its parent calendar will override the parent."

In my test case supplied, you can see that we have CalendarId-2 which has default availability and is parent to CalendarId-1 which do not have that definition. ( Note that calendarId-1 is the project calendar )

As far as I understand, CalendarId-1 should inherit his parent default availability.

Am I wrong ? , Please clarify.

Post by Maxim Gorkovsky »

Hello.
Calendar 2 has default availability
"DefaultAvailability":[  
  "12:11-20:11"
],
but calendar 1 has it's own default availability overriden and set to empty array:
"DefaultAvailability":[  

]
You should remove that from your data.json, or provide some value.

Post by odedglas »

Ok,
Is there anything else I should remove ? Or just this property ?
(The goal is that calendar-1 will take all of the definitions from calendar-2)

And another thing, On the advanced example, when i set Nightshift calendar to be the parent of General calendar, defaultAvailability attribute is not removed from General..

** I tried to remove the defaultAvailability attribute as you said, still getting this error.

Post by Maxim Gorkovsky »

According to our guide only defaultAvailability and weekendsAreWorkdays are "inherited" like that from parent (calendar instance will look to it's parent value if it wasn't configured with such property). Every other config will be taken from the calendar class.
When you create a class instance and want to use default values, you just omit them from config. It works for components and models (which in this case calendars are). Thus, you should omit defaultAvailability/weekendAreWorkDays from child calendar if you want it to inhert them.

But now it wouldn't work, because we found an issue with such inheritance and opened a ticket to fix it: https://www.assembla.com/spaces/bryntum/tickets/2621 While we're working on this you'll have to provide defaultAvailability to every calendar.

Post Reply