Skip to content

Timeline Events

Handle data updates and user interactions with the Timeline component.

EventDescription
onupdateFired when timeline data changes
onupdate?: (self: Timeline, items: []) => void

Handle timeline updates:

<html>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/style.min.css" />
<script src="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/index.min.js"></script>

<div id="root"></div>

<script>
const { Timeline } = calendarjs;

Timeline(document.getElementById('root'), {
    data: [
        { title: 'Project Started', date: '2025-01-01' },
        { title: 'Milestone 1', date: '2025-02-01' }
    ],
    onupdate: function(self, items) {
        console.log('Timeline updated:', items.length, 'items');
    }
});
</script>
</html>