none
hiding the view button on sharepoint list RRS feed

  • Question

  • Is it possible to hide the buttons below? I don’t want employees who has full control of this list to click that. 


    kumar

    Tuesday, November 5, 2019 6:45 AM

All replies

  • Hi

    You can do it with js or css as below:

    //Hide tool line
    document.getElementById("CSRListViewControlDivWPQ2").style.display="none";
    
    //Hide views list
    document.getElementById("WPQ2_ListTitleViewSelectorMenu_Container").style.display="none";
    

    OR

    #CSRListViewControlDivWPQ2{
    display:none;
    }
    #WPQ2_ListTitleViewSelectorMenu_Container{
    display:none;
    }


    Please remember to mark the replies as answers if they helped.
    Linyu - SharePoint Engineer
    QQ Group: 72637444

    Wednesday, November 6, 2019 2:16 AM
  • Hi Linyus,

    Can you give me clear steps on how to do? 

    Thank you


    kumar

    Wednesday, November 6, 2019 4:48 AM
  • Hi kumar,

    Edit the list view page, and insert a Content Editor web part, paste the CSS code below to hide the views:

    <style>
    
    #WPQ2_ListTitleViewSelectorMenu_Container_surfaceopt1{
    
    display:none;
    
    }
    
    #WPQ2_ListTitleViewSelectorMenu_Container_surfaceopt2{
    
    display:none;
    
    }
    
    </style>

    We can use F12 to get the relevant view ID, if there are other views in your list, you can change the ID in the css code.

    Best regards,

    Grace Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, November 6, 2019 9:02 AM
    Moderator
  • Hi kumar,

    Is there any update?

    If the post helps you, you can mark it as answer.

    Best regards,

    Grace Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, November 11, 2019 2:58 AM
    Moderator
  • Hi kumar,

    I’m checking how the things are going on about this issue. Whether the post helps you?

    If you need further help, please feel free to let us know.

    Best regards,

    Grace Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, November 13, 2019 8:45 AM
    Moderator