1
jQuery 라이브러리 (jstree)를 사용하여 트리를 그립니다. 페이지가로드 될 때 처음으로 트리를 그립니다. 그러나 버튼을 눌러 트리 데이터를 업데이트하면 실패하고 div가 비게됩니다. 아래는 데이터를 새로 고치는 코드입니다.트리 (jstree) 다시 그리기 방법
$('#jsstree').html("");
jQuery("jsstree").jstree("destroy");
$('#jsstree').jstree({
'core': {
'data': [
{ "id": "ajson1", "parent": "#", "text": "Simple root node" },
{ "id": "ajson2", "parent": "#", "text": "Root node 2" },
{ "id": "ajson3", "parent": "ajson2", "text": "Child 1" },
{ "id": "ajson4", "parent": "ajson2", "text": "Child 2" },
]
}
});
내가 jQuery를이 ("jsstree")''$해야한다'생각 ('#의 jsstree') ' – Blazemonger