I'm trying to access an element located in a cell inside of an array, that's inside of another array.
I've tried several methods but everything returns undefined.
json:
[
{"assignment":"Tom" , "cell":["Tom", "2013-10-06", "Client 3", "Activity", "Scheduled" ]}
]
jquery:
$.getJSON('data/gridData1.json',function(json){
var grid = json;
filterGrid(grid, ele);
});
This code does return an array perfectly fine.
javascript:
function filterGrid(filter, ele){
var types = ['Activity','Alert','Lead','Notification'];
var newTable = [];
var cs1 = $("option:selected", ele).attr("class");
var option = $("select[name='datagrid_filter'] option:selected").text().trim();
if(cs1 == 'type'){
for(var i = 0; i < types.length; i++){
if(types[i]==option){
for(var k = 0; k < filter.length; k++){
if(**filter[0][0][0].value==option**){
newTable.push(filter[k]);
}
}
break;
}
}
}
buildGrid(newTable);
}
Doesn't return anything, including the first element. Any ideas would be great, that.
filter
. What doesfilterGrid()
do?