BALKANGraph / FamilyTreeJS

Build family tree app with BALKAN FamilyTreeJS library. Family Tree also called a genealogy or a pedigree chart, is a chart representing family relationships in a conventional tree structure.
50 stars 16 forks source link

How to get events on node event on Click only ? #107

Closed gopi15699sptr closed 1 month ago

gopi15699sptr commented 1 month ago

I am using swipe on top of the card using - nodeMouseClick: FamilyTree.action.pan, also family.onNodeClick((args) => { console.log("onClick",args) });

In this above mentioned event getting triggered onnodeClick and also swipe top of the card . I want to trigger only on node click

Screenshot 2024-05-08 at 10 22 33 PM
ZornitsaPesheva commented 1 month ago

The click is triggered because you click on the node to swipe. Please explain what you need to achieve. You want to avoid moving the chart on click?

gopi15699sptr commented 1 month ago

Actually , I want to trigger a event to show customized edit form on click , but when I swipe on top of the card also edit form get triggered , thats the issue

ZornitsaPesheva commented 1 month ago

But we use the same option for edit and pan. So you can use pan or edit. To open edit, you can use double click: https://code.balkan.app/org-chart-js/open-details-on-double-click#JS

gopi15699sptr commented 1 month ago

Is this is only option to resolve my issue ?

ZornitsaPesheva commented 1 month ago

I will check and let you know.

ZornitsaPesheva commented 1 month ago

We have created a code demo for you: https://code.balkan.app/org-chart-js/pan-and-click#JS

gopi15699sptr commented 1 month ago

Yes great! , its working , but one more scenario missed which is on click on node Tree menu also event gets triggered , we dont want that , only want to get event trigger on node click

Screenshot 2024-05-09 at 2 10 38 PM
ZornitsaPesheva commented 1 month ago

The event onNodeClick is not triggered on nodeTreeMenu button click. Did you mean something else?

gopi15699sptr commented 1 month ago

No , When I click on Node event is getting triggered, above mentioned issue resolved , But another issue came for when I nodeTreeMenu that time also node event getting triggered, I dont want that

ZornitsaPesheva commented 1 month ago

How can I reproduce the issue in the below code example? https://code.balkan.app/family-tree-js/pan-and-click#JS

gopi15699sptr commented 1 month ago

No this issue resolved