I am creating a dynamic table from a SharePoint list and displaying it on a page. the way I am looping through the listitems and finding a match with certain categories which incidentally creates a lot of duplicates. I found the code below to eliminate duplicates:
var seen = {};$('table tr').each(function() {
var txt = $(this).text();
if (seen[txt])
$(this).remove();
else
seen[txt] = true;
});
However, what I really need is to eliminate duplicates between two <tr>s with <tr class="content_header">. In other words, I would like to remove all duplicates that fall between two trs with class="content_header". How can I modify the code above to achieve what I need? the above code removes all duplicates, but I need some duplicates as long as the duplicates are not within two rows with class="content_header" as these rows are my collapsible rows.
Any idea?
faye fouladi