almende / chap-links-library

a web based visualization library for displaying graphs, networks, and timelines
http://almende.github.com/chap-links-library
Apache License 2.0
599 stars 167 forks source link

Timeline: cancelChange() doesn’t restore item’s original dates in data table #304

Closed nerone closed 10 years ago

nerone commented 10 years ago

Trying to get data table using getData() method within changed event after calling cancelChange(), keeps item’s new start and end date values, but not the original ones.

josdejong commented 10 years ago

Thanks, this bug is fixed now (fixed version is not yet released).

saarthakgupta commented 10 years ago

hey,, im facing the same issue. when will the fixed version release?

josdejong commented 10 years ago

Good point, will do that soon.

saarthakgupta commented 10 years ago

thanks :)

josdejong commented 10 years ago

We've just released Timeline v2.9.0. Enjoy!

saarthakgupta commented 10 years ago

thanks mate.. cheers !!

saarthakgupta commented 10 years ago

hi.. i just tested it and it seems that the bug is still persistent. Im using a json data string to plot the data on the timeline. here is my code to add the listener to the timeline (please pardon the formatting) :

var timeline = new links.Timeline(document.getElementById('myDivHere'));
links.events.addListener(timeline,'onchanged', function(){
             var selected = timeline.getSelection();
                if (selected.length) {
                    if (selected[0].row != undefined) {
                      var row = selected[0].row;
                           if (row != undefined) {
                       timeline.cancelChange();
                 } 
                    }
                }
     });

Please check.

josdejong commented 10 years ago

I think your 'onchanged' callback is never fired, the event is called 'changed', like:

links.events.addListener(timeline, 'changed', function(){
  // ...
}