1

SP 2016 OnPrem:

I have a custom list view with a JSLink and it's doing everything I need. However, when I sort or filter the view and then use "Save This View", the JSLink property disappears on the new view and it doesn't contain any of my customizations.

On the view page I have a .css and another .js file in CEWP's, both of which are still active in the new view after using Save this View.

1) Is there anyway to force the new views to retain the JSLink automatically? In production I will have many end users needing this functionality and they won't be able to add it on the fly.

2) If we can't retain the JSLink, is there another way to accomplish the same things a JSLink does using a standard .js file inside of a CEWP? ie, Changing column headers, manipulating field values, creating anchor links in fields other than the Title, etc. (This is really a generic question about the concept instead of one specific problem.)

Thank you

0

In your case you need to to add JSLink property to the whole list (SPList) instead of a separate view since you want to make sure the script always runs even on new views.

To answer your questions:

  1. Yes, assign JSLink to a list.
  2. I don't think CEWP is a solution, just use list as a paret for the JSLink.

Tip: You can do quick tests with the Cisar Chrome extension.

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.