Our pure JavaScript Scheduler component


Post by marcio »

Hey juris,

Glad that's working now! Yes, you can change it, just like the locationField, you can add a label property.

resourceField: {
      label: "Custom name",
      items: [
        { id: 11, name: 'Seat 1', color: 'red' },
        { id: 12, name: 'Seat 2', color: 'blue' },
        { id: 21, name: 'Seat 1', color: 'red' },
        { id: 22, name: 'Seat 2', color: 'blue' }
      ]
    }

Best regards,
Márcio


Post by juris »

Hi Márcio,

thank you very much for your quick reply!

Now everthing is working as we want, thank you very much! Now only the styling is missing and regarding the styling we would like to ask if following structure would be possible for the columns on the right side:

Screenshot_3.png
Screenshot_3.png (9.15 KiB) Viewed 510 times

The left column is the room and the right column the seat.

Thank you in advance and kind regards!


Post by alex.l »

All the best,
Alex


Post by juris »

Hi Alex,

thank you very much, I will have a look on it.

Thank you and kindregards!


Post by juris »

The mergeCells feature works like a charm, thank you very much.

But I still have a question, is it also possible to have another ressource displayed like this:

Screenshot_1.png
Screenshot_1.png (24.22 KiB) Viewed 454 times

Could this be achieved with a combination of the tree and mergeCells features?

Thank you in advance and best regards!


Post by alex.l »

Sorry, it's not clear what exactly are you looking for? Grouping or empty lines in first column?

All the best,
Alex


Post by juris »

Hi Alex,

thanks for your response and sorry for not providing more informations so I will try again.

For our use case, we need to be able to book seats/tables for each room. We could already implement this with the help of the mergeCells and it looks like this:

Screenshot_2.png
Screenshot_2.png (40.29 KiB) Viewed 449 times

This is how we structured our resources currently:

"resources" : {
    "rows" : [
      {
        "id"       : 1,
        "room"     : "Room A",
        "name": "Room A Seat 1",
        "seat": "Seat 1"
      },
      {
        "id"       : 2,
        "room"     : "Room A",
        "name": "Room A Seat 2",
        "seat": "Seat 2"
      },
      {
        "id"       : 3,
        "room"     : "Room A",
        "name": "Room A Seat 3",
        "seat": "Seat 3"
      },

  {
    "id"       : 4,
    "room"     : "Room B",
    "name": "Room B Seat 1",
    "seat": "Seat 1"
  },
  {
    "id"       : 5,
    "room"     : "Room B",
    "name": "Room B Seat 2",
    "seat": "Seat 2"
  },
  {
    "id"       : 6,
    "room"     : "Room B",
    "name": "Room B Seat 3",
    "seat": "Seat 3"
  },
  {
    "id": 7,
    "room": "Room B",
    "name": "Room B Seat 4",
    "seat": "Seat 4"
  }
]
  },

However, it should now also be possible to book individual persons in addition to the seats/tables:

Screenshot_1.png
Screenshot_1.png (24.22 KiB) Viewed 449 times

We have already tried to combine the tree and mergeCell feature but without success. Therefore we would like to ask if and how we can implement this.

I hope this explains my request better.

Also is it possible to remove the header of the columns of the resources?

Thank you in advance and best regards!


Post by alex.l »

How the data structure should looks like?
Room contains tables, that's clear. How persons should be stored? Do they child nodes of rooms or just separated entities?
Or one person has few rooms inside? As for me, I don't understand why do you need to store rooms and persons (different entity types) in one store. Maybe data structure should be changed? Or all of them are Resources? Or you only need to mark that some person is staying in some room?

All the best,
Alex


Post by juris »

Hey Alex,

thank you very much for your answere!

I have now clarified the requirements again and the resources should look as follows:

The structure for the rooms and tables stay the same but the persons are separated entities/resources. The reason for this would be to have the availability of the rooms/tables with the availability of the people at a glance and to be able to book the tables accordingly.

So is it possible to use different entities or resources in one scheduler?


Post by alex.l »

That's the general question for your database structure as well. One table usually contains records with one data model. Same with Store. If you set some "type" attribute and will base your extra logic on that value, that's doable.
I would suggest you to look at these instruments and decide which one will better fit your needs:

https://bryntum.com/docs/scheduler/api/Grid/feature/Tree
https://bryntum.com/examples/grid/tree/
https://bryntum.com/docs/scheduler/api/Grid/feature/TreeGroup
https://bryntum.com/docs/scheduler/api/Grid/feature/Group
https://bryntum.com/examples/grid/grouping/
https://bryntum.com/examples/scheduler/grouping/
https://bryntum.com/examples/scheduler/tree/

Also is it possible to remove the header of the columns of the resources?

You could provide empty text as a value for column title, but you cannot hide it because it will affect on time axis part also, it should be on the same level to look synced.

All the best,
Alex


Post Reply