Skip to Content
0

SAPUI5 Gantt: Problem Using Calendardef

Feb 02 at 03:33 PM

254

avatar image

Hi Experts,

i got a problem using calendardefs in order to visualize weekends/holidays in sapui5 gantt chart.

Can you please advise how to model structure should look like and how to bind it?

I allready check the following question:

https://answers.sap.com/questions/185889/sapui5-gantt-calendar-in-backround-calendardef-max.html

I coded the binding exact the same as in the question above. But i guess my model is not accurate. The gantt view still looks like this:

Please advise!

Thanks in advance and best regards,

Stephan

calendardef.png (63.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Björn Burandt Mar 26 at 05:59 PM
1

Hey Stephan Pichler,

i've checked my code another time and i forgot an important part:

Did you already define the calendar like the normal shapes and add it ?

I hope that this solves the problem.

Regards

Björn


Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Björn Burandt,

the missing shape was the problem.

Weekends and factory cal are now coming up accurate.

Thanks a lot! :)
Stephan

1
Björn Burandt Mar 22 at 04:03 PM
1

Hello,

your chart really looks nice ;)

I can show you an example of the code in our application:

I've defined the gantt-control in xml.

You can put the calendarDefinition on the gantt-chart with "setCalendarDef". In there you can define the path to the calendar-entries, the key and timeInterval-locations.

The OData-Structure:

I've used a JSON-Model - so there is one Part with the calendar-entries und one for our tree in the gantt-diagram.

The connection between calendar-entries and row (children) is the calendar id --> "cal".

In every children there are the masterinformations, the defined shape (in our case: just one shape per line) and the calendar-informations (the key).

So in our case every line has the same calendar - always "cal", it's also possible to define different calendar-informations per line.

If you have more questions - just ask.

Also helpful for topics like this is this page: https://sapui5.hana.ondemand.com/sdk/test-resources/testsuite/testframe.html

Just search for "gantt" and open the "Complex" or "Compete" in a new tab for debugging. There are also examples with different calendars.

Best regards

Björn


calendar.png (32.3 kB)
calendar-code.png (21.5 kB)
Share
10 |10000 characters needed characters left characters exceeded
Stephan Pichler Mar 23 at 07:19 AM
0

Hi Björn Burandt ,

first of all, thank you for your detailed post!

unfortunately, it still doesnt work, this is how my Model looks like:

caldef-model.png

i only put in one timeinterval for testing, but it doesnt come up.

My binding is the same code segment as in your application:

caldef-binding.png

calendardef still looks blank:

gantt-ss.png

any further idea?

Thanks!

Stephan


caldef-model.png (27.9 kB)
caldef-binding.png (12.6 kB)
gantt-ss.png (19.5 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Addition: i tried both date formats:

cal-format.png (4.3 kB)
0