In this article, I would like to enhance your Client Side Rendering code patterns in SharePoint 2013. Here we will see how can we make Title column or field read only using SPClientTempltes and JSLink in SharePoint Online/2013/2106.
Scenario Make Title field read-only while Item editing
My client asked me to implement a quick change by making Title field read only when item is editing. This must be a quick and must not include any VS code as it has to be deployed in O365.
Solution using SPClientTempltes and JSLink
I have implemented a solution using SPClientTemplates and added this as a JSLink reference as part of view in list item edit page.
Please follow the below steps to achieve this:
- Copy the below code block and save it as “ttlReadOnlyEditPage.js”
- Copy / upload the js file on to site asserts / any document library
- Open the list and click on any list item
- Edit the list item
- Click on edit page option as part of site setting gear icon
- Edit list view webpart and find for miscellaneous zone
- Refer the js file copied in Asserts library and apply the changes
- Save the page edit change.
————- Code Block Start ————————
You may like following jslink in SharePoint 2013 tutorials:
- SharePoint Online: Change SharePoint ListView To Jquery Accordion Using JSLink Client Side Rendering
- SharePoint 2013/2016/Online: Working with JSLink Templates Fields
- SharePoint 2013/2016/Online: How to Load multiple js file in JSLink
- SharePoint 2013 jslink list view examples: Add header and footer to list view web part using JSLink in SharePoint Online/2013/2016
- Customize list view using jslink in SharePoint 2013/2016/Online
- How to use JSLink in SharePoint 2013/2016/Online
- Change the SharePoint List View into JQuery News Ticker Using JS Link CSR
- SharePoint Online Branding: Display List items into page using AngularJS and REST API in SharePoint online or SharePoint 2016/2013
SharePoint Online FREE Training
JOIN a FREE SharePoint Video Course (3 Part Video Series)