Я использую OrgChart. js (BalkanGraph), и я читаю свои данные с сервера sql с помощью Ajax, но я не знаю, как я показываю свои узлы Orgchart. введите описание изображения здесь
это мой сценарий:
<script >
var chart = new OrgChart(document.getElementById("tree"), {
nodeBinding: {
field_0: "UO",
field_1:"Uo_Rattachement"
},
menu: {
pdf: { text: "Export PDF" },
png: { text: "Export PNG" },
svg: { text: "Export SVG" },
csv: { text: "Export CSV" }
},
nodeContextMenu: {
edit: { text: "Edit", icon: OrgChart.icon.edit(18, 18, '#039BE5') },
add: { text: "Add", icon: OrgChart.icon.add(18, 18, '#FF8304') }
},
nodeMenu: {
details: { text: "Details" },
edit: { text: "Edit" },
add: { text: "Add" },
remove: { text: "Remove" }
},
nodes: []
});
$.ajax({
type: "POST",
url: "WebForm1.aspx/ReadData",
//data: ( list),
dataType: "json",
contentType: "application/json",
traditional: true,
success: function (response) {
if (response != null && response.d != null) {
var data = response.d;//this data already is json which represent list of Node so that you can iterate with each
$.each(data, function (index, node) {
console.log(node);
});
}
}
});
мне нужно показать мои данные в виде узлов оргструктуры, как я могу это сделать !! спасибо