I have the following piece of JS code that shows All Views associated with a SharePoint list (without having to use the contextual menu):
<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(IncreaseSurfacePivotCount, 'clienttemplates.js');
function IncreaseSurfacePivotCount() {
ClientPivotControl.prototype.SurfacedPivotCount = 4;
};
</script>
This code works flawlessly when pasted inside a script editor web part. Since I'll need to edit the pivot count periodically when new views are added, I'd prefer to save this code within my Site Assets folder and reference it instead.
Here is what I've tried unsuccessfully:
- Saved above snippet in Notepad++ as
Show_All_Views.js - Stored file in Site Assets folder. This folder is named
SiteAssets (DC) - Inserted Script Editor Web Part on the pages and used the following:
<script type="text/javascript" src="../SiteAssets%20(DC)/Show_All_Views.js"></script>
Can someone help understand what I'm doing wrong. I've followed the instructions in this similar thread exactly.