0

For the jonmiles treeview plugin, how do I define in the json data that certain nodes are checked by default?

the following is completely ignored:

[{
        "text": "Parent 1",
        "checked": true,
        "nodes": [{
                "text": "Child 1",
                "nodes": [{
                        "text": "Grandchild 1"
                    },
                    {
                        "text": "Grandchild 2"
                    }
                ]
            },
            {
                "text": "Child 2"
            }
        ]
    },
    {
        "text": "Parent 2"
    },
    {
        "text": "Parent 3"
    },
    {
        "text": "Parent 4"
    },
    {
        "text": "Parent 5"
    }
]
Geshode
  • 3,600
  • 6
  • 18
  • 32
Patrick Kwinten
  • 1,988
  • 2
  • 14
  • 26

1 Answers1

1

It should work, if you use:

{
    "text": "Parent 1",
    "state": {
        "checked": true
    }
}

You forgot to put the state property. For reference look at data structure in the readme.

Geshode
  • 3,600
  • 6
  • 18
  • 32