Using jsonSelect Plugin I am trying to do a query select as below. I am presenting this example.
How can I retrieve the All Project and Contractors who has the Projects in "North" ProjectArea? I already tried this to get the contractor's name but it didn't work
var contractors = [{
"contractor1": [{
"project": "Project 2",
"projectArea": "South"
},
{
"project": "Project 101",
"projectArea": "East"
}],
"contractor2": [{
"project": "Project 500",
"projectArea": "North"
},
{
"project": "Projetc 108",
"projectArea": "West"
}]
}]
var stringSelect = 'has(:root > .projectArea:val("North"))';
JSONSelect.forEach(stringSelect, contractors, function (resultObj) {
$('body').append('<p>' + resultObj + '</p>');
});