Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
for (var i in listData) {
...
//underneath these lines in the Display Template
if (ctx.RefinementControl.propertyName == "MediaDuration") {
Srch.U.modifyMediaDurationRefinementName(listData[i]);
}
/*
an alternative to the approach below would be to store the array indexes of the refinements you want to remove in a
seperate array and then reverse this array before doing the deletions.
*/
if (listData[i].RefinementValue === '<VALUE YOU WANT TO REMOVE>') {
listData[i].MarkedForDeletion = true;
} else {
listData[i].MarkedForDeletion = false;
}
...
}
...
var c = listData.length - 1;
while (c > 0) {
if (listData[c].MarkedForDeletion) {
delete listData[c - 1];
}
c -= 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment