![]() |
ChatGPT 8/6/2025 |
Yes, you can dynamically change the calendar event colors in PHPRunner based on certain criteria such as event type, status, or any other attributes you have in your database. Here's how you can do it:
By following these steps, you should be able to dynamically change the event colors in your PHPRunner application. If you have specific conditions or fields you want to use for determining the colors, you can modify the switch statement accordingly. |
C
|
Chris Whitehead author 8/6/2025 |
Sorry Mr Chat, that din't twerk, I'm open to other ideas if you have any, if not what about anyone else? Dropped this into the calendar before display event, while it works, it's not ideal. ?> |
![]() |
Sergey Kornilov admin 8/7/2025 |
Could you explain the complete scenario? Colors are based on Category field values, changing category field will change the color as well. Just trying to understand how your scenario is different and what kind of API we can add to make this kind of change easier. |
C
|
Chris Whitehead author 8/9/2025 |
Yes, no problem @Sergey Kornilov. I know the calendar is new and this might not be possible yet, or if ever, but here's what I'm trying to achieve. I currently have the background event type/categories contained within a table as below. I know I can change these colours in the calendar section, but these are then fixed within the application by matching the event ids to the colour. I would like to use the background colour values which are stored in the table rather than "fix" them in the application so each user could select their own category colours. Here's how I'm currently updating them, I have to put a timeout in which does show them change colours. $rs = DB::Query("SELECT bg_colour,type_details FROM calendar_events_types"); |
![]() |
Sergey Kornilov admin 8/9/2025 |
Thank you, makes sense. Colors definition coming from the database is a great scenario and we'll see how we can make this easier. |