Browse Source

Merge pull request #444 from motzel/develop

Fixed onAdd/onUpdate callbacks not working when using DataView in Timeline
v3_develop
Jos de Jong 10 years ago
parent
commit
fc47ae26a9
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/timeline/component/ItemSet.js

+ 2
- 2
lib/timeline/component/ItemSet.js View File

@ -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?
}
});

Loading…
Cancel
Save