Coder Social home page Coder Social logo

Comments (4)

tomekit avatar tomekit commented on September 26, 2024

Hi @swframe,
Sorry for reaching to you directly, but I was wondering if you've managed to find a solution to this issue?
We're also looking to lazy load list of files within folders and hoped there is an example here before we scratch heads ourselves.

from animated_tree_view.

swframe avatar swframe commented on September 26, 2024

I wrote a temporary solution but it repaints the tree when the nodes open/close.
I store the nodes that are opened and when that Set changes I completely rebuild the tree.
I only load the children if the node is in the 'opened' set. I cache the children so once they
are loaded, they are not reloaded until the cache expires. I add a fake child to each node that
is closed so the UI will draw '>' to let the user know the node is not a leaf.

This is really hacky but it allows me to work on other features.
I will continue to work on it to implement a more efficient way to open and close
without needing to rebuild the entire tree widget. It shouldn't be too hard.

from animated_tree_view.

tomekit avatar tomekit commented on September 26, 2024

Thanks, we've addressed some of these issues and provided lazy load example: main...tomekit:animated_tree_view:main#diff-2f45cb6453ada31c3ecd0f5cc5e11dedac8361c32f724278a9ccb4b749dbd435

There shouldn't be need to add fake child items or repaint tree.

I am not sure what else might come up at this stage, but with these changes we're happy to integrate it within our project.

from animated_tree_view.

swframe avatar swframe commented on September 26, 2024

Thanks! I will try it out.

from animated_tree_view.

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.