Git Product home page Git Product logo

Comments (7)

azizali avatar azizali commented on May 12, 2024

Great question.

The onCheckToggleCb callback function will only get the list of nodes that got toggled.
The onUpdateCbcallback will get the full data.

You can determine the parent of checked/unchecked node by finding it in the full tree.

from react-super-treeview.

renant avatar renant commented on May 12, 2024

So the correct one would implement on the onUpdateCb callback, I was trying on the onCheckToggleCb callback ...

I'll try later with onUpdateCb and report here

Thank you

from react-super-treeview.

azizali avatar azizali commented on May 12, 2024

from react-super-treeview.

renant avatar renant commented on May 12, 2024

Hi @azizali , how's it going?

Sorry for the delay, I was able to do this through a combination of 'onCheckToggleCb' and 'onUpdateCb'

I got the last selected node in 'onCheckToggleCb' and found the parent by reference in 'onUpdateCb' and checked this

Thanks for the help, and sorry my bad english

from react-super-treeview.

azizali avatar azizali commented on May 12, 2024

from react-super-treeview.

c623700 avatar c623700 commented on May 12, 2024

Hi @azizali , how's it going?

Sorry for the delay, I was able to do this through a combination of 'onCheckToggleCb' and 'onUpdateCb'

I got the last selected node in 'onCheckToggleCb' and found the parent by reference in 'onUpdateCb' and checked this

Thanks for the help, and sorry my bad english

I would interest in how you implement your solution, specially how to manage to pass the reference of the box that was checked, to the onUpdateCb. Thanks in advance

from react-super-treeview.

 avatar commented on May 12, 2024

I strongly recommend using react-checkbox-tree if you need this functionality (which is a must for a tree-view component). I hardly managed to check the upper parents but even in that case component doesn't half-check the parent and couldn't make it do that since it's not created considering this functionality.

from react-super-treeview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.