i have set a html-form in this text box i change the title, content, start- and end-time. By a click on 'okay'-button change the dataitem. How can i refresh the timline?
Code from onlclick-Button
var onClickEditOkay = function () {
if (selItemNr != null){
var start = new Date(dummyDate);
var sh = tbStart.value.split(":");
start.setHours(parseInt(sh[0]));
start.setMinutes(parseInt(sh[1]));
var end = new Date(dummyDate);
sh = tbEnd.value.split(":");
end.setHours(parseInt(sh[0]));
end.setMinutes(parseInt(sh[1]));
timeline.itemsData._data[selItemNr].start = start;
timeline.itemsData._data[selItemNr].end = end;
timeline.itemsData._data[selItemNr].title = tbTitle.value;
timeline.itemsData._data[selItemNr].content = tbContent.value;
timeline.redraw();
}
};
The values of item is correct set also the start and end, but the timline shows nothing change.
regards Mario
i have found the solution:
The javascrtipt class store the _data.id into cuItemId and in the OnClick function i call timeline.itemdData.update().
var onClickEditOkay = function () {
if (selItemNr != null){
var start = new Date(dummyDate);
var sh = tbStart.value.split(":");
start.setHours(parseInt(sh[0]));
start.setMinutes(parseInt(sh[1]));
var end = new Date(dummyDate);
sh = tbEnd.value.split(":");
end.setHours(parseInt(sh[0]));
end.setMinutes(parseInt(sh[1]));
timeline.itemsData.update({id: cuItemId, start: start,end: end, title: tbTitle.value, content: tbContent.value});
}
};
That works fine. regards Mario