I'm trying to add a JSLink to the 'AllItems.aspx' view of a standard task list in SharePoint 2013. For this I'm using the following PowerShell snippet.
$SPSite = Get-SPSite "http://devserver/sites/mysc" $SPWeb = $SPSite.OpenWeb() $listViewUrl = $SPWeb.Url + "/Lists/Tasks/AllItems.aspx" $SPView = $SPWeb.GetViewFromUrl($listViewUrl); $SPView.JSLink = "~sitecollection/SiteAssets/all.js|hierarchytaskslist.js" $SPView.Update() $SPWeb.Update()
The JSLink information is saved but the JS file is not loaded when I refresh the list. When I add the JSLink to another view with the above snippet everything is working as expected. Does somebody know why it is not working on the default view?