Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.

Commit 3a2b781

Browse files
bradhTooa
authored andcommitted
docs(timeline): Update docs and example to suggest being explicit about item overrides. (#2806)
This is to reduce breakage if the fallback / default changes in a future release.
1 parent eba3cf8 commit 3a2b781

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

docs/timeline/index.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ <h3 id="items">Items</h3>
357357
<td class="indent">editable.updateTime</td>
358358
<td>boolean</td>
359359
<td>no</td>
360-
<td>If true, items can be dragged to another moment int time. See section <a href="#Editing_Items">Editing Items</a> for a detailed explanation.</td>
360+
<td>If true, items can be dragged to another moment in time. See section <a href="#Editing_Items">Editing Items</a> for a detailed explanation.</td>
361361
</tr>
362362
</table>
363363

@@ -1698,6 +1698,14 @@ <h2 id="Editing_Items">Editing Items</h2>
16981698
]);
16991699
</pre>
17001700

1701+
<p>
1702+
Individual manipulation actions (<code>updateTime</code>, <code>updateGroup</code> and <code>remove</code>) can also be set on individual items. If any of the item-level
1703+
actions are specified (and <code>overrideItems</code> is not <code>false</code>) then that takes precedence over the settings at the timeline level. Current behavior is
1704+
that if any of the item-level actions are not specified, those items get <code>undefined</code> value (rather than inheriting from the timeline level). This may change
1705+
in future major releases, and code that specifies all item level values will handle major release changes better. That is, instead of using
1706+
<code>editable: {updateTime : true}</code>, use <code>editable: {updateTime : true, updateGroup: false, remove: false}</code>.
1707+
</p>
1708+
17011709
<p>
17021710
One can specify callback functions to validate changes made by the user. There are a number of callback functions for this purpose:
17031711
</p>

examples/timeline/editing/individualEditableItems.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<div id="visualization"></div>
3535

3636
<script>
37-
// create groups to highligh groupUpdate
37+
// create groups to highlight groupUpdate
3838
var groups = new vis.DataSet([
3939
{id: 1, content: 'Group 1'},
4040
{id: 2, content: 'Group 2'}
@@ -45,9 +45,9 @@
4545
{id: 2, content: 'Editable', editable: true, start: '2010-08-23T23:00:00', group: 2},
4646
{id: 3, content: 'Read-only', editable: false, start: '2010-08-24T16:00:00', group: 1},
4747
{id: 4, content: 'Read-only', editable: false, start: '2010-08-26', end: '2010-09-02', group: 2},
48-
{id: 5, content: 'Edit Time Only', editable: { updateTime: true }, start: '2010-08-28', group: 1},
49-
{id: 6, content: 'Edit Group Only', editable: { updateGroup: true }, start: '2010-08-29', group: 2},
50-
{id: 7, content: 'Remove Only', editable: { remove: true }, start: '2010-08-31', end: '2010-09-03', group: 1},
48+
{id: 5, content: 'Edit Time Only', editable: { updateTime: true, updateGroup: false, remove: false }, start: '2010-08-28', group: 1},
49+
{id: 6, content: 'Edit Group Only', editable: { updateTime: false, updateGroup: true, remove: false }, start: '2010-08-29', group: 2},
50+
{id: 7, content: 'Remove Only', editable: { updateTime: false, updateGroup: false, remove: true }, start: '2010-08-31', end: '2010-09-03', group: 1},
5151
{id: 8, content: 'Default', start: '2010-09-04T12:00:00', group: 2}
5252
]);
5353

@@ -60,4 +60,4 @@
6060

6161
</script>
6262
</body>
63-
</html>
63+
</html>

0 commit comments

Comments
 (0)