Git Product home page Git Product logo

Comments (6)

fritz-c avatar fritz-c commented on July 18, 2024
  1. Does taglevel change based on its position / depth in the tree?
  2. Are you using a custom getNodeKey? (Some sample code of yours might help)
  3. Do you want to keep all the things with titles at the top level and just edit the children below the top level?

from react-sortable-tree.

yarnball avatar yarnball commented on July 18, 2024
  1. Yes, taglevel should change depending on its' position / depth
  2. I tried with getNodeKey without success.
  3. No- the titles are not important. The important part it is the taglevel

Thanks

Here is a sample of the code:

 constructor(props) {
        super(props);

        const renderDepthTitle = ({ taglevel }) => `Depth: ${taglevel.length}`;

        this.state = {
            searchString: '',
            searchFocusIndex: 0,
            searchFoundCount: null,
            treeData: [
                {
        "title": "Into the Wild",
        "tag": [
            {
                "name": "Movie",
                "taglevel": 1,
                "id": 1
            },
            {
                "name": "Adventure",
                "taglevel": 2,
                "id": 30
            },
            {
                "name": "Book",
                "taglevel": 1,
                "id": 2
            }
        ],
        "info": []
    },
    {
        "title": "Karate Kid",
        "tag": [
            {
                "name": "Movie",
                "taglevel": 1,
                "id": 1
            },
            {
                "name": "Blockbuster",
                "taglevel": 2,
                "id": 29
            },
            {
                "name": "Kids",
                "taglevel": 3,
                "id": 4
            }
        ],
        "info": []
    },
        {
        "title": "The Alchemist",
        "tag": [
            {
                "name": "Book",
                "taglevel": 1,
                "id": 2
            },
            {
                "name": "Adventure",
                "taglevel": 2,
                "id": 30
            },
            {
                "name": "Classic",
                "taglevel": 2,
                "id": 4
            },
            {
                "name": "Words",
                "taglevel": 4,
                "id": 4
            }
        ],
        "info": []
    };

        this.updateTreeData = this.updateTreeData.bind(this);
        this.expandAll = this.expandAll.bind(this);
        this.collapseAll = this.collapseAll.bind(this);
    }

from react-sortable-tree.

fritz-c avatar fritz-c commented on July 18, 2024

What are the rules for generating taglevel? What does it represent?

from react-sortable-tree.

yarnball avatar yarnball commented on July 18, 2024

The taglevel is initially generated by the user. Then I want them to be able to "re-map" the taglevel by arranging it above

from react-sortable-tree.

fritz-c avatar fritz-c commented on July 18, 2024

If there's only one level of depth (under each titled node), and you're just changing the order, I would suggest using a sortable library that doesn't have to deal with the inherent complexity of a tree structure.

from react-sortable-tree.

yarnball avatar yarnball commented on July 18, 2024

Actually there would be several depths under each node. The idea is to visually show show this via depth

from react-sortable-tree.

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.