BALKANGraph / OrgChartJS

OrgChart JS is a simple, flexible and highly customizable organization chart plugin for presenting the structure of your organization and the relationships in an elegant way.
https://balkan.app/orgchartjs
252 stars 84 forks source link

Separate edit forms for Employees and Departments #867

Open ArchilRostiashvili opened 2 weeks ago

ArchilRostiashvili commented 2 weeks ago

Hi, I want to make the editForm different when editing Employees versus Departments, with at least some different fields in the modal. What’s the best way to implement this? I’m asking after reviewing demos (none covered this) and checking the Docs + API. (Edit: I found a solution by hiding fields based on tags, but I'd still like to know if there's a better approach.) scrn1 scrn2

ZornitsaPesheva commented 2 weeks ago

Here is a code example of how you can have different edit forms: https://code.balkan.app/org-chart-js/custom-edit-for-a-node#JS

ArchilRostiashvili commented 2 weeks ago

Thanks for the reply, however that was not exactly what I asked about (the question is more about the best way to implement forms with different fields (like name, department name, etc) and design for different things) the code snippet you provided is more about buttons of the form.

ZornitsaPesheva commented 2 weeks ago

The same way you can change chart.config.editForm.elements Here is an example: https://code.balkan.app/org-chart-js/kanban-board#JS

ArchilRostiashvili commented 2 weeks ago

Exactly what I needed, much thanks!