Skip to content

Instantly share code, notes, and snippets.

@beckettkev
Last active December 17, 2015 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beckettkev/b4f195744ae660f5857f to your computer and use it in GitHub Desktop.
Save beckettkev/b4f195744ae660f5857f to your computer and use it in GitHub Desktop.
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