Ace_tree dynamic assignment problem

1, I spliced an ace_tree background data from the background through ajax, which is a string, and then returned to the foreground. If I assign this string to the ace_tree, I cannot recognize
var treeDataSource = new DataSourceTree ({data: tree_data})
2, but if I write the result of my background spelling manually in the foreground and do a static assignment, I can display it.

clipboard.png
I"d like to ask you if you need to convert this string before the receptionist can recognize it.

Mar.10,2021

parse

let data = JSON.parse("....")

if it's not a standard json, use this

.
let data = eval('(' + json+ ')')


does not understand your question, there seems to be a similar article on Open Source China.

Menu