Last active
December 17, 2015 15:02
-
-
Save beckettkev/b4f195744ae660f5857f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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