Here is a small example:
var distinctValues = [];
distinctValues.push("Value1");
distinctValues.push("Value2");
var firstValue = distinctValues[0];
var searchResults = [];
var data = grid.jqGrid('getGridParam', 'data');
data.forEach(function (row) {
searchResults[searchResults.length] =
{
"ID" : row.ID,
"CreatedBy": row.CreatedBy,
"UpdatedBy": row.UpdatedBy
}
}
How do I look firstValue("Value1") inside searchResults array and retrieve the CreatedBy information?
//something like this - this is wrong syntax by the way
if ($.inArray(firstValue, searchResults) != -1) {
alert(searchResults["CreatedBy"]);
}