Our powerful JS Calendar component


Post by GabiNucci95 »

Hello!

How do I edit the list of calendars for the field highligted on the print? In wich part I populate this field? Because on my application it only shows 'undefined'.

Attachments
calendar.png
calendar.png (35.54 KiB) Viewed 1702 times

Post by pmiklashevich »

Hello!

Calendars are your resources in scope of the Calendar product. Please checkout this guide: https://www.bryntum.com/docs/calendar/#guides/data/project_data.md

The primary collections of the Project are:

Resources store. This is a flat store, keeping all resources (Calendars) of the Project. The collection is represented by a ResourceStore. The entity is represented by a ResourceModel.

You can check any of our demos to see what data is used, for example Basic demo:
Calendar/examples/basic/data/data.json

{
    "success"    : true,
    "resources"  : {
        "rows" : [
            {
                "id"         : "bryntum",
                "name"       : "Bryntum team",
                "eventColor" : "blue"
            },
            {
                "id"         : "hotel",
                "name"       : "Hotel Park",
                "eventColor" : "orange"
            },
            {
                "id"         : "michael",
                "name"       : "Michael Johnson",
                "eventColor" : "deep-orange"
            }
        ]
    },

Cheers!

Pavlo Miklashevych
Sr. Frontend Developer


Post by GabiNucci95 »

I've tryed to enter on Resources Store to see how to change my calendar, but the page doesn't exists.

Attachments
calendar.png
calendar.png (82.88 KiB) Viewed 1698 times

Post by pmiklashevich »

Oops, sorry. We will get this fixed. The stores and models are based on Scheduler. Please replace "#Calendar" with "#Scheduler" in the URL:

// replace this URL
https://www.bryntum.com/docs/calendar/#Calendar/model/ProjectModel#property-resourceStore
// With this one
https://www.bryntum.com/docs/calendar/#Scheduler/model/ProjectModel#property-resourceStore

Pavlo Miklashevych
Sr. Frontend Developer


Post by GabiNucci95 »

I did everything and still not showing the category that I want to create. Can you give me more details to include calendars on the Calendar field? In the documentation i'ts not clear how I'm suppost to do.

Attachments
calendar5.png
calendar5.png (47.63 KiB) Viewed 1695 times
calendar4.png
calendar4.png (53.1 KiB) Viewed 1695 times

Post by mats »

@GabiNucci95 When asking for help, please always include a full runnable test case or the code showing the relevant details. It's impossible to guess what's wrong based on a screenshot.


Post by GabiNucci95 »

The problem is that I can't find on the documentation where do I include a new category of calendar. In the Bryntum Calendar examples there always more then on type of Calendar like in this print that I'm sending. In those examples, there is no how to implement this list of calendars.

Attachments
calendar6.png
calendar6.png (154.28 KiB) Viewed 1694 times

Post by pmiklashevich »

This list is a representation of what the resource store contains. Whenever you change the data in the store, your list is updated.
Please go to https://www.bryntum.com/examples/calendar/basic/ and open developer console. Run in console:

calendar.resourceStore.map(calendar => calendar.name)
// (3) ["Bryntum team", "Hotel Park", "Michael Johnson"]

You can see there are 3 calendars (resources)
You can remove them. Run this line:

calendar.resourceStore.removeAll()

You can see "No results" in the list:

Снимок экрана 2020-10-13 в 17.45.19.png
Снимок экрана 2020-10-13 в 17.45.19.png (435.04 KiB) Viewed 1693 times

You can add a new calendar:

calendar.resourceStore.add({ id : 'new_cal', name : 'My cal' })
Снимок экрана 2020-10-13 в 17.46.47.png
Снимок экрана 2020-10-13 в 17.46.47.png (454.14 KiB) Viewed 1693 times

Please let us know how to get "undefined" calendars. To create a testcase please modify one of our examples. How to ask for help is described here: viewtopic.php?f=35&t=772

Best regards,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post by pmiklashevich »

By the way, I see you are using the crud manager. Please check out these guide & docs:
https://www.bryntum.com/docs/calendar/#guides/data/crud_manager.md
https://www.bryntum.com/docs/calendar/#Scheduler/data/CrudManager

Pavlo Miklashevych
Sr. Frontend Developer


Post by GabiNucci95 »

There are no errors. My problem is that I need to include two calendars: Personal and Appointments. And I don't know if I do this add on TS, HTML or on the calendar.config.ts. This information is not clear on your documentation.


Post Reply