Build family tree app with BALKAN FamilyTreeJS library. Family Tree also called a genealogy or a pedigree chart, is a chart representing family relationships in a conventional tree structure.
50
stars
16
forks
source link
Question : How to save Family Tree in database ? #82
In the documentation i didn't found an example of saving the Tree in database (SQLite for eg).
How to proceed ?
Maybe this way but it is not elegant :
1) Intercept the "onUpdateNode" event
2) Export the tree in CSV
let csv = OrgChart.convertNodesToCsv(family.config.nodes);
3) Save CSV in database with my backend code
And Import CSV from database when i want to open my project?
StringBuilder sb = new StringBuilder();
using (var p = ChoCSVReader.LoadText(myJsonFromDb)
.WithFirstLineHeader()
)
{
using (var w = new ChoJSONWriter(sb))
w.Write(p);
}
Hello,
In the documentation i didn't found an example of saving the Tree in database (SQLite for eg). How to proceed ?
Maybe this way but it is not elegant : 1) Intercept the "onUpdateNode" event 2) Export the tree in CSV
let csv = OrgChart.convertNodesToCsv(family.config.nodes);
3) Save CSV in database with my backend codeAnd Import CSV from database when i want to open my project?
What is the best way to do this?
Thanks.