vassago/WebInterface/Views/Home/Index.cshtml
Adam R Grey b4b5544ec4 channels and accounts organized into a treeview
even if every account is orphaned, this isn't how it should be
2024-05-26 19:43:17 -04:00

60 lines
1.9 KiB
Plaintext

@{
ViewData["Title"] = "Home Page";
}
<div id="tree"></div>
tree above.
@section Scripts{
<script type="text/javascript">
function getTree() {
// Some logic to retrieve, or generate tree structure
var tree = @Html.Raw(ViewData["treeString"]);
console.log(tree);
@* var channels = {text: "channels", nodes: []};
@{
var doThing = (currentChannel) => {};
foreach(Channel c in ViewData["Channels"])
{
channels.push(currentChannel);
}
} *@
var throwaway =
[
{
text: "Parent 1",
nodes: [
{
text: "Child 1",
nodes: [
{
text: "Grandchild 1"
},
{
text: "Grandchild 2"
}
]
},
{
text: "Child 2"
}
]
},
{
text: "Parent 2"
},
{
text: "Parent 3"
},
{
text: "Parent 4"
},
{
text: "Parent 5"
}
];
return tree;
}
$('#tree').bstreeview({ data: getTree() });
</script>
}