Timeline Y sections duplicates

Hi,

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:

Folder: Object { key: 52, label: "FOLDER 1", upId: 108, open: 1, children: Array[9], level: 0 } Children: Object { key: 52, label: "CHILDREN 1", up: "108", categoria: 112, teContracte: "1", level: 1 }

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.

Events (XML): dl.dropboxusercontent.com/u/171128/events.xml
Sections (JSON): dl.dropboxusercontent.com/u/171 … tions.json

Sections before SQL modification, with these the events are shown normally in the scheduler: dl.dropboxusercontent.com/u/171 … ginal.json

I can’t find an explanation… :cry:

For me it doesn’t work with both json files.

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?

y_property:"necessitatId"

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.

Thx

You need to change the XML generation logic, to remove whitespaces around section id
Currently it is like next

<necessitatId><![CDATA[ 47 ]]></necessitatId>

and need to be

<necessitatId><![CDATA[47]]></necessitatId>

Because of extra white spaces event can’t be linked to section (“47” != " 47 ")

I can’t find that. In the XML I posted (dl.dropboxusercontent.com/u/171128/events.xml) I can’t see this space, what I see is:

Where did you see it?

Anyway I don’t think it’s problem of XML, because the same XML for the sections without the key altered works ok.

Sorry, it was Chrome formatting for XML files :blush:

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 :blush: :blush: :blush:

Many many thx for your patience and attention :slight_smile: