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
251 stars 84 forks source link

Separate edit forms for Employees and Departments #867

Open ArchilRostiashvili opened 1 week ago

ArchilRostiashvili commented 1 week 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 1 week 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 1 week 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 1 week 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 1 week ago

Exactly what I needed, much thanks!