Adding and removing calendar events dynamically

Hello all,

Our client wanted a time off calendar for the users to utilize through ignition. I’m having a hard time figuring out the best way to add and remove calendar events. I currently have it set up using the “month view” calendar component, and I set up a script using “system.dataset.addrow” to add in new data to the “calendar events” dataset. I’m having trouble trying to figure out how to remove a specific event, given that multiple events on the calendar might have the same description. Is there a tool to modify a dataset from the window, that operates similar to the dataset viewer? Here is what it looks like so far:

Any ideas on how to make this work, or make it simpler for the user?


I’ve actually had to do something very similar for a customer in the past. They wanted a plant scheduling feature that I implemented via a popup window and the month view component. I primarily relied on python to get the certain event and SQL for adding or removing the event. My approach was a script to display a popup menu whenever the user right clicked on a day, and they could select what they wanted to do. Whenever they would click a day, I would grab the date of the day they clicked and if there was more than one event in between the beginning of that day and midnight, it would display a popup that they could select which event they wanted to remove. Although it doesn’t appear you’re using SQL here, I don’t see why the same thing couldn’t be done with a dataset in Ignition.

You could also have the script to remove events on the table in the bottom right. ID’ing the events would probably also be very helpful.

Hope this helps

The component has a selectedEvent property, which is just the row number of the event in the events dataset. Then just use system.dataset.deleteRow.

If I wanted to make the specific row number visible in the table so the users would know what event coordinates with a specific row number, is there a way I can make it show up?

Bind the selectedRow property on the table to the selectedEvent property on the calendar.

1 Like

That looks like it will work. Thanks!