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

chart.editUI.on('field', function(sender,args) isn't working on professional version 8.13.34 #821

Open ryanlaw opened 4 months ago

ryanlaw commented 4 months ago

we are using professional version 8.13.34, and we wish to do something about the selectbox we put inside the editUI (e.g. make some value selected based on data stored DB). We found a code snipe (https://jsfiddle.net/5gwa7scp/1/) done by ZornitsaPesheva. However the same code section:

chart.editUI.on('field', function(sender,args) { console.log(sender); console.log(args); });

doesn't do anything with the js file shipped with the professional.

Can anyone please help?

Thanks and regards

ZornitsaPesheva commented 4 months ago

editUI.on('field'... is deprecated since version 7 Can you please create a Code example of what you have and show us with screenshots if possib;le what do you need to do?

ryanlaw commented 4 months ago

Hi ZornitsaPesheva, Thanks for your reply and here is the code snipe: https://code.balkan.app/821#JS At the detail window we see: image and when we get into the editUI the dropdown of the country is not selected properly. image We were hoping to use the editUI.on('field' to do the selected. If it has been deprecated, is there any other way we archive what we wanted?

Thanks

ryanlaw commented 4 months ago

Furthermore, when saving the editUI, country codes were returned and saved. Is there anyway to return and save its actual text instead?

ZornitsaPesheva commented 4 months ago

Here is a code demo on how to use a dropdown in the edit form: https://code.balkan.app/org-chart-js/dropdown-list-selection-in-edit-form#JS

ryanlaw commented 4 months ago

Thanks ZornitsaPesheva, you are really helpful

ryanlaw commented 4 months ago

Hi @ZornitsaPesheva , There is an error when creating a new node with your sample and open the editUI. image

Do you know why is it?

Thanks

ZornitsaPesheva commented 4 months ago

Could you please edit this example to isolate the issue? https://code.balkan.app/org-chart-js/dropdown-list-selection-in-edit-form#JS

ryanlaw commented 4 months ago

Hi @ZornitsaPesheva ,

Thanks for you following up.

There is no need to modify the examples you provided: https://code.balkan.app/org-chart-js/dropdown-list-selection-in-edit-form#JS

Steps to reproduce the issue:

  1. create a new node from an existing node
  2. edit the new node you just created

Thanks

ZornitsaPesheva commented 4 months ago

I have fixed the issue by moving the focus on another element, addin focusBinding: "Title"

ZornitsaPesheva commented 2 months ago

Hi, did you manage to solve this issue?