1
我正在循环显示列表中的行w/$.each
,并在每行应用一组筛选器$.each
。我想跳过不匹配的行。这有点类似于:
$.each(data, function(i, row) {
count = parseInt(row['n']);
year = row['year'];
if (options.filters) {
$.each(options.filters, function(filter, filtervalue) {
if (row[filter] != filtervalue) return true;
});
}
// Will only get here if all filters have passed
}
我怎样才能得到嵌套循环$.each
跳过如果filtervalue
不匹配给定的过滤器行?