Fancytree source 부분을 ajax로 db의 데이터를 로드해오려고 다음과 같이 코딩했는데,
source: $.ajax({
type: 'POST',
url: '/api/callData',
data: {pPage: 8, pPageCount: dataPerPage},
dataType: "json",
cache: false,
success: function(response) {
console.log("response.data");
console.log(JSON.stringify(response.data));
console.log($("#tree").fancytree("getTree").data);
}
}),
자꾸 Fancytree assertion failed: if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data') 에러가 발생합니다.
구글링해봤지만 해결책을 못찾아서 글올리게되었습니다. 해결책 아시는 분은 답변 남겨주시면 감사하겠습니다.