vLookup Search 2.0
- This topic has 2 replies, 2 voices, and was last updated 6 years, 2 months ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › vLooup for SharePoint › vLookup Search 2.0
Hi Alexander,
I’ve seen your forum article regarding highlighting of vlookup lines matching text in a search box.
Is it also possible to hide the whole line that doesn’t match dynamically ?
I’ve tried with CSS display:none but this doesn’t work unfortunately.
Thank you very much in advance.
BR,
Chris
You can change the code like this:
function highlightMatches(elm, fin) {
var sVal = jQuery(elm).val(),
container = jQuery("#vLookup_" + fin + "_" + spjs.dffs.data.thisItemID).find(".vLookupTable");
container.find("tr.vLookupTableRow").removeClass("highlightSearchMatchInvLookup").show();
if (sVal !== "") {
container.find("tr.vLookupTableRow").each(function(i, tr) {
if (jQuery(tr).text().match(sVal) !== null) {
jQuery(tr).addClass("highlightSearchMatchInvLookup");
}else{
jQuery(tr).hide();
}
});
}
}
Alexander
Link to original forum post: https://spjsblog.com/forums/topic/vlookup-search/
Hi Alexander,
Thank you very much for the perfect solution, it works very well 🙂
BR,
Chris