How do I delete a marked timespan by specifying an id? The docs example literally shows you can just pass the id of a created timespan into the deleteMarkedTimespan method:
This, however, doesn’t seem to work for me. Here is the example: DHTMLX Snippet Tool
Click the “Remove Blocked” button - nothing happens despite the fact I am passing the id. If I don’t pass the id, it removes all the blocked successfully but I want to be able to remove particular timespans only.
You are returning only the first ID when several are created (please note: even when passing only 1 “configuration” object → several configs are created). What’s the reason behind this?
Are they linked in some object? In which? (but it doesn’t look so)
Then you try to look up the config of the timespan by the id but you find only the one which you returned, of course… while ignoring the rest which never get removed from the _marked_timespans array.
Possible solution:
return an array from addMarkedTimespan
use this array in deleteMarkedTimespan as param instead of “id” /and improve your if (typeof configuration != "object") check, of course, as it would be true for the array
and then remove all the passed id configs from the _marked_timespans array
I tested removing them like that but sadly I cannot use it because it removes the overlapping blocked timespan as well, see this: http://snippet.dhtmlx.com/5/fa38f0aae
I added an additional marked timespan (id3) for days 3 and 5. If you click the delete button it removes them, too. I do not want to remove those.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan