OrgChart: Custom fields / Template with edit button

1 Answer 475 Views
OrgChart
Oliver
Top achievements
Rank 1
Oliver asked on 27 Feb 2022, 09:52 AM | edited on 27 Feb 2022, 10:00 AM

 

Hello,

two questions regarding the OrgChart ...

is it possible to use additional custom fields in the OrgChart or is that limited to Id, ParentId, Name, Title, Avatar, Expanded?

If a template is used, how to get the edit, create, delete menu displayed? is it possible to use an EditorTemplate?

 

Thank you for your help.

Best regard, Oliver

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetomir
Telerik team
answered on 02 Mar 2022, 11:43 AM

Hi Oliver,

Any additional fields to the OrgChart can be declared via the Field option of the data source:

m.Field(f=>f.FieldName);

Regarding the editing of the widget, the corresponding events are attached dynamically. Therefore, all that is needed is to add the HTML for the context menu to your card template and it should work out automatically.

As per the editing form, currently, the form can be customized item-wise, however, setting an explicit edit template is not exposed. You could modify the options of the form as follows:

    .Editable(e=>e.Form(f=>f.Items(i=>i.Add())))

 

Kind regards,
Tsvetomir
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Oliver
Top achievements
Rank 1
commented on 02 Mar 2022, 06:09 PM

Hello Tsvetomir,

thanks for your answer, that's exactly what I was looking for :)

Best regard, Oliver

Tags
OrgChart
Asked by
Oliver
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or