0

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?

0

Solved my own problem. Problem was related to the list on which I wanted to apply my JSLink file. Somehow the list seems to be corrupted.

Created a new list and everything is working as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.