azizali / react-super-treeview

👏 Finally, a React Treeview component which is customizable on every level
https://azizali.github.io/react-super-treeview/examples/
MIT License
99 stars 40 forks source link

[Feature] Add a onNodeSelected callback #12

Open nitrogene opened 6 years ago

nitrogene commented 6 years ago

Maybe i am missing something, but i could not find a way to trigger some actions when a node is selected ( In the following example, when by example "Titre 1" is selected)

capture

azizali commented 6 years ago

Here is the example of that http://azizali.com/react-super-treeview/examples/#checkbox

When a note is checked this callback gets triggerred onCheckToggleCb

You can write a function that will run every time something is checked/unchecked.

Also this component has multi-check option. You can press shift on your keyboard and then check a range of notes. In that case the same prop onCheckToggleCb will trigger. This time with all the the nodes which were checked/unchecked.

nitrogene commented 6 years ago

Is there a way to hide the checkboxes, while keeping the same behavior ?

nitrogene commented 6 years ago

Something puzzles me. Using your example, if I click anywhere on a node line (starting from the checkbox and ending with the X mark), the callback is fired. In my case, the event is fired only if I click on the check box. The only difference I see is that i set isDeletable to false....

azizali commented 6 years ago

Oh so like making the select feature on click of the label and not show the check box?

This is not currently possible but I can add that in the next version.

On Wed, Aug 29, 2018, 10:03 AM Gervasoni notifications@github.com wrote:

Is there a way to hide the checkboxes, while keeping the same behavior ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/azizali/react-super-treeview/issues/12#issuecomment-416986302, or mute the thread https://github.com/notifications/unsubscribe-auth/ACfoLKq3bNVf2CqtiXL1l2Z-fd9PLFo5ks5uVq0ugaJpZM4WPvyT .

nitrogene commented 6 years ago

That would be great :)

Le mer. 29 août 2018 à 17:49, Aziz Ali notifications@github.com a écrit :

Oh so like making the select feature on click of the label and not show the check box?

This is not currently possible but I can add that in the next version.

On Wed, Aug 29, 2018, 10:03 AM Gervasoni notifications@github.com wrote:

Is there a way to hide the checkboxes, while keeping the same behavior ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/azizali/react-super-treeview/issues/12#issuecomment-416986302 , or mute the thread < https://github.com/notifications/unsubscribe-auth/ACfoLKq3bNVf2CqtiXL1l2Z-fd9PLFo5ks5uVq0ugaJpZM4WPvyT

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/azizali/react-super-treeview/issues/12#issuecomment-417001430, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQztPT6xE2mXmDauAlfVbkmZLhNmMoxks5uVrfzgaJpZM4WPvyT .

jason2li commented 6 years ago

Agreed, I would like this feature as well.

sandipbgt commented 5 years ago

any update on this feature?

karthikaditya commented 2 years ago

HI @azizali , is there a update on this feature?