Browse Source

Fixed onAdd/onUpdate callbacks not working when using DataView in Timeline

v3_develop
Bogdan Modzelewski 10 years ago
parent
commit
d760f3d98a
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 var itemData = me.itemsData.get(item.id); // get a clone of the data from the dataset
this.options.onUpdate(itemData, function (itemData) { this.options.onUpdate(itemData, function (itemData) {
if (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 // execute async handler to customize (or cancel) adding an item
this.options.onAdd(newItem, function (item) { this.options.onAdd(newItem, function (item) {
if (item) { if (item) {
me.itemsData.add(item);
me.itemsData.getDataSet().add(item);
// TODO: need to trigger a redraw? // TODO: need to trigger a redraw?
} }
}); });

Loading…
Cancel
Save