vLookup Search 2.0

Home Forums vLooup for SharePoint vLookup Search 2.0

Viewing 2 reply threads
  • Author
    Posts
    • #31363

      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

    • #31377
      Alexander Bautz
      Keymaster

        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/

        • This reply was modified 4 years, 3 months ago by Alexander Bautz. Reason: Added link to original post
      • #31413

        Hi Alexander,

        Thank you very much for the perfect solution, it works very well 🙂

        BR,
        Chris

    Viewing 2 reply threads
    • You must be logged in to reply to this topic.