Lost Functionality When Changing Out of the Box View Styles

Issue

Have you changed the style of your SharePoint list view by changing the out of the box (OOTB) view settings (adding shading for example)? If you have, you may have noticed a loss of functionality. Two things happen, you lose your links to the other views (shown active here):
views1

and secondly you lose the ability to Quick Edit (AKA datasheet view):

quickedit2

I don’t know about you but those are two important features to me!

Solution

Thankfully there is a pretty simple solution using OOTB functionality and a little coding provided for you here.

1. Click on the cogwheel and click on ‘Edit page’.

settings

2. Click on ‘Add a Web Part’ in the Main area of the page.

addawebpart

3. In the ribbon that opens up at the top of the page, select ‘Media and Content’ and then ‘Script Editor’.

mediacontentscripteditor

4. When the web part opens up, click on ‘EDIT SNIPPET’ to the far right of the web part.

editsnippet

5. Now you will enter the code exactly as provided below. Just copy and paste it into the Embed screen that pops up and click ‘Insert’. It should be noted that the default color that has been selected is the color that would normally show up in when selecting the ‘Shaded’ style.

*CODE:

<style>
.ms-alternating
{
background-color:#f1f1f1;
}
< /style>

code 6. The nice thing about the Script Editor web part is that it is automatically hidden on the page. But it is best practice to move the web part below the actual list. Let’s minimize the list so we just see the two web parts and no text. In the web part that contains the list, click on the small arrow and ‘Edit Web Part’.

editwebpart

7. Click on the Script Editor and move the web part until you see the name of the web part show up in the middle of the screen in blue under the list web part and then release it.

movedwebpart8. When you are done you should see the Script Editor below your list web part.

movedwebpart1

9. Let’s restore the list so that we can see the content. Click on the arrow on the right side of the web part and select ‘Restore’.

restore

10. We are now done with our fix so let’s stop editing the page to save our changes. Click on ‘Page’ and then ‘Stop Editing’.

stopediting

 

As you can see below, we now have the shading as well as the Quick Edit!

viewsupdated

NOTE: If you have several views that you want shading, you will need to do this process on each view.

Now that you have finished this process, you may notice that you no longer see List or Items in the top left:

missinglinks

This is because the page that the list resides on just turned into a web part page because there are more than one web parts on the page. The list web part AND the Script Editor web part. To activate the List or Items menu ribbon, either click on an item in the list (WITHOUT opening the item in a new window). This should activate the ribbon.

activated

*Code was taken and modified from comments on this blog post by Hey Tamara! – Links to Additional Views Disappear When OOTB Style is Applied

Update: This will not work if the Master Page has been edited. I added it to a list and the whole page was blank. Thanks to SharePoint Designer I was able to delete the Script Editor and get my list back.

Leave a comment