1

Hey

As the title indicates, I wanna know who to disable the search preview (that on search result web part)

Because on the onload of the SharePoint page, i have a list who contains my folder .

It appeared when i added a query rules in the panel "Build Query" (I added a property filter)

Just look my picture, i want the folder disappear and just have my search box on the onload

I know we can disable ALL preview feature with sharepoint admin center but that not what i'm looking for i just want fot this page.

enter image description here

Thanks for your help.

1 Answer 1

0

I looked at html code and noted that if your search results web part has id WebPartWPQ2 then when you search something it changes the style attribute of it's second div with search results.

So you can write JS code:

window.onload=function(){
  document.getElementById("WebPartWPQ2").childNodes[1].style.display="none";
}

This none value would be replaced by searching function.

UPD. Ah, it's for on-premise SP where I tested it.

1
  • that doesn't work, nothing happens :c
    – hmourier
    Commented May 25, 2018 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.