Skip to content

Regarding refreshing a single node. #2807

@TonyXuChen

Description

@TonyXuChen

const deviceOptions = ref({
"core": {
"themes": {
"responsive": false
},
"data": getJstreeData()//Data is dynamically retrieved from the interface.
},
"types": {
"default": {
"icon": "ri-community-fill text-primary"
},
"0": {
"icon": "ri-database-fill text-secondary"
},
"1": {
"icon": "ri-database-fill text-success"
},
"2": {
"icon": "ri-database-fill text-danger"
}

},
"plugins": ["types"]

})
I'm setting different icons based on the value of the "type" property. However, after finding a node using something like let node = $('#jstree').jstree(true).get_node('XXXX'), and then modifying both node.type and node.original.type, refreshing the node using $('#jstree').jstree(true).redraw_node(node, true, false, false); doesn't switch the node's icon to the correct icon corresponding to the type. Why is this happening? How can I achieve the icon switching that I need?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions