From d760f3d98a03f61a05177bf2d20d7473e95d021f Mon Sep 17 00:00:00 2001 From: Bogdan Modzelewski Date: Sat, 15 Nov 2014 21:43:32 +0100 Subject: [PATCH] Fixed onAdd/onUpdate callbacks not working when using DataView in Timeline --- lib/timeline/component/ItemSet.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index 31232bc9..94c5a3c8 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -1343,7 +1343,7 @@ ItemSet.prototype._onAddItem = function (event) { var itemData = me.itemsData.get(item.id); // get a clone of the data from the dataset this.options.onUpdate(itemData, function (itemData) { if (itemData) { - me.itemsData.update(itemData); + me.itemsData.getDataSet().update(itemData); } }); } @@ -1373,7 +1373,7 @@ ItemSet.prototype._onAddItem = function (event) { // execute async handler to customize (or cancel) adding an item this.options.onAdd(newItem, function (item) { if (item) { - me.itemsData.add(item); + me.itemsData.getDataSet().add(item); // TODO: need to trigger a redraw? } });