Skip to content

Timeline Editor

The editorTimeline is a custom cell editor for RevoGrid that provides a visual timeline interface for managing date ranges directly within grid cells.

Source code
import { defineCustomElements } from '@revolist/revogrid/loader';
import { editorTimeline } from '@revolist/revogrid-pro';
import { currentTheme } from '../composables/useRandomData';
defineCustomElements();
export function load(parentSelector: string) {
const grid = document.createElement('revo-grid');
grid.range = true;
grid.source = [
{ name: 'Project Planning', timeline: { from: '2024-01-01', to: '2024-03-31' } },
{ name: 'Development Phase', timeline: { from: '2024-04-01', to: '2024-09-30' } },
{ name: 'Testing Phase', timeline: { from: '2024-10-01', to: '2024-12-31' } },
{ name: 'Deployment', timeline: { from: '2025-01-01', to: '2025-02-28' } },
];
grid.columns = [
{ prop: 'name', size: 150 },
{
name: 'Timeline',
prop: 'timeline',
cellTemplate: editorTimeline,
showWeekNumbers: true,
dateFormat: 'dd/mm/yyyy',
},
];
const { isDark } = currentTheme();
grid.theme = isDark() ? 'darkCompact' : 'compact';
grid.hideAttribution = true;
document.querySelector(parentSelector)?.appendChild(grid);
}

Features:

  • Visual timeline bar with progress indicator
  • Date range selection with native date pickers
  • Progress tracking based on current date
  • Responsive design that fits within grid cells