Contents
Why is my jslink not showing the correct URL?
If I then again edit the page and go to webpart properties for the listview the jslink still contains the correct URL and I can again click apply and the custom formatting is applied to the view, but again when I save it stops working.
1. Create your List (Including Views) 2. Create your JavaScript File: 3. Set the JSLink property of your Web Part Client-side rendering or JSLink is a new concept in SharePoint 2013. With the help of this concept, you can customize the look and feel of SharePoint Out of the box VIEW/ADD/EDIT FORM.
Which is better jslink or XSLT for web rendering?
To learn more about URL strings and tokens, see the Dev Center at bit.ly/1lpYuAP. Client-side rendering using JSLink has a number of advantages over XSL/XSLT. In the first place, it uses JavaScript, with which most Web developers are already comfortable.
How to add a reference to jslink file?
Add the reference to JSLink file: If you have placed your JS inside SiteAssets library of some CHILD site, you should use ~site/SiteAssets/ URL. If you have placed your JS inside SiteAssets library of root site of the site collection, you should use ~sitecollection/SiteAssets// URL.
How to make the jslink file start to work?
The JSLink file started to work (perhaps this is why some others have had mixed results as well). If you will notice I dropped the ~site/dev/js/… and in its place I put just the ~sitecollection/… token.
How to attach a jslink to a listview?
What you should try is, attach it to the view itself and not the web part. Run this powershell script to set the JSLink, then refresh your listview’s View again in Web Part Properties. (I like storing my .js in _layouts but it could go elsewhere such as a Scripts library).
How to set jslink in web part properties?
I find setting the JSLink in the Web part properties unreliable. I could only get it to work by storing the .js in certain places. What you should try is, attach it to the view itself and not the web part. Run this powershell script to set the JSLink, then refresh your listview’s View again in Web Part Properties.