Introduction
This blog demonstrates how to show more Views in SharePoint List as, by default, only two Views are visible.
To view all the views SharePoint
First, create a .txt file and paste the following code into that text file. You can name the file as ShowallViews.txt.
- <script type="text/javascript">
- ExecuteOrDelayUntilScriptLoaded(overrideSurfacePivotCount, 'clienttemplates.js');
- function overrideSurfacePivotCount() {
- ClientPivotControl.prototype.SurfacedPivotCount = 5;
- };
- </script>
Now, upload this file to Site Assets library in SharePoint.
Go to the listview in SharePoint where you would like to see all the Views on the SharePoint Page and then, click on "Edit Page", as shown in the screenshot below.
Click on "Add a Web part" >> Media And Content >> Content Editor and then click on "Add" button, as shown in the image below.
After adding the web part, click on the down arrow and select "Edit Web Part" as shown in the screenshot below.
Scroll to the right of the page and in the Content Link property, paste the link to the txt file that was uploaded to the Site Assets Gallery, namely ShowallViews.txt. Click OK.
Now, you will see all the Views of the SharePoint List horizontally.
Summary
In this article, we discussed how we can show all list views horizontally as out of the box we can only see two list views.