Has anyone worked out how to get GLinks to produce JSON?
I'm finding some difficulties adding the right ['s and {'s etc (basically, 'enclosing' sublists in those - how the heck?)
Something with <%first%> and <%last%> in loops?
Any ideas?
The below is an example of JSON:
"name": "Categories",
"id": "root",
"children": [
{
"name": "Cat1",
"children": [
{
"name": "Cat1.1",
"children": [
{
"name": "Cat1.1.1",
"children": [
{
"name": "Cat1.1.1.1",
"data": {
"$color": "#21ff59"
}
}, {
"name": "Cat1.1.1.2",
"data": {
"$color": "#21ff59"
}
}, {
"name": "Cat1.1.1.3",
"children": [
{
"name": "Cat1.1.1.3.1",
"data": {
"$color": "#21ffc8"
}
}, {
"name": "Cat1.1.1.3.2",
"data": {
"$color": "#21ffc8"
}
}, {
"name": "Cat1.1.1.3.3",
"data": {
"$color": "#21ffc8"
}
}, {
"name": "Cat1.1.1.3.4",
"data": {
"$color": "#21ffc8"
}
}
],
"data": {
"$color": "#21ff59"
}
}, {
"name": "Cat1.1.1.4",
"data": {
"$color": "#21ff59"
}
}, {
"name": "Cat1.1.1.5",
"children": [
{
"name": "Cat1.1.1.5.1",
"children": [
{
"name": "Cat1.1.1.5.1.1",
"data": {
"$color": "#21c8ff"
}
}, { ......
I'm finding some difficulties adding the right ['s and {'s etc (basically, 'enclosing' sublists in those - how the heck?)
Something with <%first%> and <%last%> in loops?
Any ideas?
The below is an example of JSON:
Code:
var json = { "name": "Categories",
"id": "root",
"children": [
{
"name": "Cat1",
"children": [
{
"name": "Cat1.1",
"children": [
{
"name": "Cat1.1.1",
"children": [
{
"name": "Cat1.1.1.1",
"data": {
"$color": "#21ff59"
}
}, {
"name": "Cat1.1.1.2",
"data": {
"$color": "#21ff59"
}
}, {
"name": "Cat1.1.1.3",
"children": [
{
"name": "Cat1.1.1.3.1",
"data": {
"$color": "#21ffc8"
}
}, {
"name": "Cat1.1.1.3.2",
"data": {
"$color": "#21ffc8"
}
}, {
"name": "Cat1.1.1.3.3",
"data": {
"$color": "#21ffc8"
}
}, {
"name": "Cat1.1.1.3.4",
"data": {
"$color": "#21ffc8"
}
}
],
"data": {
"$color": "#21ff59"
}
}, {
"name": "Cat1.1.1.4",
"data": {
"$color": "#21ff59"
}
}, {
"name": "Cat1.1.1.5",
"children": [
{
"name": "Cat1.1.1.5.1",
"children": [
{
"name": "Cat1.1.1.5.1.1",
"data": {
"$color": "#21c8ff"
}
}, { ......