I am trying to make changes to an C# based opensource json editor which has MIT license. I want to remove the items like ({object}, {Array}) from the Json tree view. here is the link to the Open source Json Editor and here is the link (Clicking on this link will download the JSON-EDITOR)to a editor which i used as a reference for Expected output.
Test.json
{
"TEST JSON" : "JSON",
"JSON":{
"ANIMALS":[
{
"ID":0,
"TYPE":"DOG",
"DOG":{
"TYPE":"RETRIEVER",
"RETRIEVER":{
"NAME":"LEO",
"AGE":3,
"YEARS":[2019 , 2020, 2021],
"WEIGHTS": [2,10,13]
}
},
"REMARKS":{
"ID":1,
"STATUS":"GOOD",
"REFERENCE": {
"SOURCE": "XYZ",
"FIT": 1,
"BMI" : 1
}
}
},
{
"ID":1,
"TYPE":"DOG2",
"DOG2":{
"TYPE":"PUG",
"RETRIEVER":{
"NAME":"HUTCH",
"AGE":4,
"YEARS":[2019 , 2020, 2021, 2022],
"WEIGHTS": [2,3,4,4]
}
},
"REMARKS":{
"ID":1,
"TYPE" : "REFERENCE",
"STATUS":"OK",
"REFERENCE": {
"SOURCE": "XYZ",
"FIT": 1,
"BMI" : 1
}
}
},
{
"ID": 2,
"TYPE": "DIAGNOSTICS",
"STATUS": "ENABLED"
},
{
"ID": 3,
"TYPE": "ORGANISATION",
"ORGANISATION":{
"NAME":"RED CROSS",
"YEAR": 2023
}
}
]
}
}
Like shown in the images below i want to remove elements marked with red to make it look like the image on the right
There are 2 projects inside in the solution JsonEditor and JsonTreeview. There is a function called AfterExpand() in all these files
I'm sure that function is responsible for displaying those unwanted items. so i made the Text string empty in all the files this function is present so the items will be gone.
/// <inheritdoc />
public override void AfterExpand()
{
base.AfterExpand();
Text = $@"[{JArrayTag.Type}]";
// change i made
Text = "";
}
but it seems there are empty spaces being displayed now. Any help would be really appreciated. Thanks in advance.