How to sort nested JSON in the markup

99 views Asked by At

I am building a huge nested json file. On the page I want to be able to sort based on some of the nested elements. Certain pages will only show certain nests but I want to also be able to sort between categories.

For example, I need to know how to write: display all, display wire only, display GDes new only, display GDes old only etc. Any idea on how to create a simple toggle in the markup

[ {"wire":[ {"new":[ { "url": "http://galnova.com/", "folder": "pro_images" }, { "url": "http://galnova.com/", "folder": "pro_images" } ]} ]},

    {"GDes":[
        {"new":[
            {
            "url": "http://galnova.com/",
            "folder": "nu_images"
            },
            {
            "url": "http://galnova.com/",
            "folder": "nu_images"
            }
        ]}
    ]},

    {"GDes":[
        {"old":[
            {
            "url": "http://galnova.com/",
            "folder": "nu_images"
            },
            {
            "url": "http://galnova.com/",
            "folder": "nu_images"
            }
        ]}
    ]},

    {"Web":[
        {"new":[
            {
            "url": "http://galnova.com/",
            "folder": "nu_images"
            }
        ]}
    ]}
]
0

There are 0 answers