I'm using Kendo UI to create an org chart, I have different levels, I need that every element that hasn't got a child aligns vertically.
If you open the image you can see the output. I need that the fourth level in green becomes linked to the third level in red like the fifth level in red is linked with fourth level in red. How can I do that? It's really urgent, please help.
6 Answers, 1 is accepted
Thank you for the image.
Based on that I can assume that the desired result is to position the node 4 directly under the node 3:
If this is correct, please provide more details how the node 5 is related to node 4, as the same type of relationship has to be set between node 3 and 4(green).
I will be expecting the details and runnable example if possible, and I will gladly assist.
Thanks for your support; yes, you are correct, this is what I expect to have.
The node 5 and node 4 have the same type of relation of node 3 and 4 (green), every element has an id and a parent id
Example: node 5 has id: 5555-5555-5555555 and as parent id: 4444-4444-44444
node 4 has id: 4444-4444-44444
node 1 has parent id: 00000-000
I'm sorry but I can't give you a running example
Sorry for double posting, but I made a similar example in this fiddle:
replace the code with this:
Thank you for the example.
Based on the current implementation of the Diagram the observed result is expected.
The used tipOver layout will align all direct children horizontally and only the grand-children will be aligned vertically. This will set the same alignment for child row, and it currently does not allow placing some of the child nodes(on the same level) horizontally aligned and some of then vertically aligned.
I can suggest all of our layout and sub layout options to check if there is another combination which will be better suited for the scenario:
Also, I can suggest submitting a feature request for a property which can be set to the individual nodes in order to set their preferred alignment. Then based on its popularity we may implement it in a future release:
Thanks for the support.
I have just one more question, in the last example, if the fourth node (on the second level) had a child, it would be aligned vertically?
Anyways, I checked every type and subtype but the only one matching what I need is the tipover, it would be perfect if it had the option to align element without a child vertically.
Yes, the child would be positioned vertically, you can see the result by inserting one additional node:
The layout algorithms are predefined and you cannot modify their behavior. As suggested by Stefan, you can add a feature request for a different algorithm in the feedback portal.
If your Diagram is not very big and complex, you can hard-code the shapes positions, by specifying x and y values in the shapes dataSource. You can see all supported shapes binding options here:
Shape Model Fields
This Dojo shows a Diagram with hard-coded shapes positions: https://dojo.telerik.com/OMutIX/2