I’ve a timeline with Y sections in two levels: “Folders” (level 0) and “Children” (level 1). I get this sections from a database, and sometimes they have the same ID (“key”). Example:
I thought that the events aren’t loaded to the “Folders”, only to their children, but it seems it is not so, and I don’t want that. Is it possible to restrict events to be assigned only to children sections, even the parent “key” coincide with the y_property? Any other options?
Possible solution
I had an idea, but it doesn’t work I don’t know way, I hope you can help me. I changed the SQL that gets the ‘folder’ (level 0) sections to sum 99999 to the ID (key) so that not match with the children IDs. But when I change the SQL and reload, the events don’t appear! The children sections are loaded without change its ID/Key, so the y_property from the event continues coinciding with them.
With javascript ( console.log(scheduler.getEvent(34394)); ) I can check that events are loaded correctly, but I don’t know why they don’t appear in the scheduler. I compared an event object not loaded with an event object loaded without change the SQL, and I’ve seen that the normal event have these additional properties: _count:1, _inner:false, _sorder:0.
key value need to be unique
You second approach, with changing folder id looks as a correct solution. Can you share json|xml data that was loaded in to the scheduler ( both sections and events data ) in the problematic case.
Normally you need to have a property in the event object that will point to the section of timeline. In above events data the only property that look like section id is categoriaId, but there is no sections with such ID in the sections configuration.
Is some other field used for event-section linking?
The event property that links to the section is ‘necessitatId’, look for example the event id ‘34394’. It have the ‘necessitatId’ to 47, and there is the following section: {“key”:47,“label”:“UTIC DEVELOP 5”,“Descripcio”:“DEVELOPER 5”,“up”:108,“EsGuardiaPresencial”:0,“EsGuardiaLocalitzable”:0}.
Please ignore all the events without ‘necessitatId’ value, that’s because we have the same xml for two different schedulers, we don’t want to show it in this scheduler.
Please check the attached sample, it uses the same data as in your case - both xml and json. As you can see event is correctly mapped to the section ( at bottom of the view ) scheduler-test.zip (623 KB)
I debugged with your example and I found the problem. I’ve a filter that checks additional event properties against an external , and the event.upId didn’t coincide with the altered folder key. Sorry for that
Many many thx for your patience and attention
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan