How to update jstree node values without reload

前端 未结 6 2074
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-07 07:11

I have a jstree that I created with the following code:

$(\'#mytree\').jstree({\"core\": { \"data\" : value
                             , \"themes\" : { \"dots\         


        
6条回答
  •  走了就别回头了
    2021-02-07 07:34

    worked for me: $('#structureRows').jstree("destroy").empty();

    function CreateStructureTree(jsonData)
            {
                $('#structureRows').jstree("destroy").empty(); 
                $('#structureRows').jstree
                    ({
                        'core' : {
                            'data':
                                [
    
                                    jsonData,
                                    {
                                    'id' : 'node_2',
                                    'text' : 'Root node with options',
                                    'state' : { 'opened' : true, 'selected' : true },
                                    'children' : [ { 'text' : 'Child 1' }, 'Child 2']
                                    }
                                ]
    
                         }
                    });
    
                }
    

提交回复
热议问题