This is an old revision of the document!
<html> <head>
<title>Timeline | editing | Individual editable items</title>
<style>
body, html {
font-family: arial, sans-serif;
font-size: 11pt;
}
div.vis-editable,
div.vis-editable.vis-selected {
/* custom styling for editable items... */
}
div.vis-readonly,
div.vis-readonly.vis-selected {
/* custom styling for readonly items... */
background-color: #ff4500;
border-color: red;
color: white;
}
</style>
<script src="https://visjs.github.io/vis-timeline/dist/vis-timeline-graph2d.min.js"></script> <link href="https://visjs.github.io/vis-timeline/dist/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" />
</head> <body>
<p>Specify individual items to be editable or readonly.</p>
<div id=“visualization”></div>
<script>
// create groups to highlight groupUpdate
var groups = new vis.DataSet([
{id: 1, content: 'Annapolis Junction'},
{id: 2, content: 'Relay House'},
{id: 3, content: 'Elysville'},
{id: 4, content: 'Ellicott City'},
]);
// create a DataSet with items
var items = new vis.DataSet([
{id: 1, content: '<a href=“https://hococivilwar.org/upag/doku.php?id=units:20th_new_york_state_militia”>20th New York State Militia</a>', start: '1861-05-11', end: '1861-06-28', group: 1}, {id: 2, content: '<a href=“https://hococivilwar.org/upag/doku.php?id=units:69th_new_york_state_militia”>69th New York State Militia</a>', start: '1861-04-28', end: '1861-05-04', group: 1}, {id: 3, content: '<a href=“https://hococivilwar.org/upag/doku.php?id=units:5th_new_york_state_militia”>5th New York State Militia</a>', start: '1861-05-02', end: '1861-05-13', group: 1}, {id: 4, content: '<a href=“https://hococivilwar.org/upag/doku.php?id=units:13th_new_york_state_militia”>13th New York State Militia</a>', start: '1861-06-14', end: '1861-06-18', group: 1}, {id: 5, content: '<a href=“https://hococivilwar.org/upag/doku.php?id=units:1st_pennsylvania_reserve_infantry”>1st Pennsylvania Reserve Infantry</a>', start: '1861-07-27', end: '1861-08-30', group: 1}, {id: 6, content: '<a href=“https://hococivilwar.org/upag/doku.php?id=units:21st_massachusetts_infantry”>21st Massachusetts Infantry</a>', start: '1861-9-1', end: '1861-12-18', group: 1}, {id: 7, content: '1st Michigan Infantry', start: '1861-07-29', end: '1861-10-01', end: '1862-02-28', group: 1}, {id: 8, content: '144th Ohio Infantry', start: '1864-05-30', end: '1864-08-11', group: 1}, {id: 9, content: '<a href=“https://hococivilwar.org/upag/doku.php?id=units:93rd_regiment_new_york_state_militia”>93rd Regiment New York State Militia</a>', start: '1864-09-19', end: '1864-10-20', group: 1}, {id: 10, content: '<a href=“https://hococivilwar.org/upag/doku.php?id=units:10th_maine_infantry”>10th Maine Infantry</a>', start: '1862-11-03', end: '1863-03-08', group: 1}, {id: 11, content: '<a href=“https://hococivilwar.org/upag/doku.php?id=units:10th_maine_infantry”>60th New York Infantry</a>', start: '1862-03-08', end: '1862-05-24', group: 1}, {id: 12, content: '109th New York Volunteer Infantry', start: '1862-09-01', end: '1864-04-01', group: 1}, {id: 13, content: '27th Massachusetts Regiment', start: '1861-10-23', end: '1861-11-13', group: 1}, {id: 14, content: '<a href=“https://hococivilwar.org/upag/doku.php?id=units:1st_district_regiment”>1st District Regiment</a>', start: '1861-11-30', end: '1862-06-08', group: 1},
]);
var container = document.getElementById('visualization');
var options = {
editable: true // default for all items
};
var timeline = new vis.Timeline(container, items, groups, options);
</script> </body> </html>
