Hello.
I have the need to dynamic add/remove a section in a non tree timeline, and all its associated tasks.
sections are created using:
var list = scheduler.serverList("timeline_sections", [{ key: 9999999999, label: "9999999999" }, { key: 9999999998, label: "9999999998" }]);
to remove all, i use:
scheduler.clearAll();
to add a section after clearAll:
scheduler.updateCollection("timeline_sections", [{ key: 123, label: 123 }]);
now, what can i do to remove a single section and all its taks (when multiple sections are already in timeline)?
Ive tried the sugestions in:
http://forum.dhtmlx.com/viewtopic.php?f=6&t=32287&p=100793&hilit=remove+section#p100793
but havent been able to put them to work.
Regards.
SergeM
#2
Hi,
the general approach is described by Aliaksandr in the topic mentioned above. Maybe this little sample with filtration will help. In any case feel free to ask if you have some difficulties with the steps described here viewtopic.php?f=6&t=32287&p=100793&hilit=remove+section#p100793.
filter_timeline.zip (80.1 KB)
Dimass
#3
I’m using a html multiselect to show/remove sections. It isn’t the same situation like yours but it can give you an idea:
onChange: function(element, checked) {
var display = seccions.slice();//sections - complete(unfiltered) list of timeline sections
$('#filtre-seccions option').each(function() {
for (var i=0; i < display.length; i++) {
if (!$(this).is(':checked') && $(this).val() == display[i].key) {
display.splice(i,1);
i--;
}
}
});
scheduler.updateCollection("timeline_seccions", display);//update timeline reloads options and redraws the view
}