In this article, I would like to enhance your Client Side Rendering code patterns in SharePoint 2013.
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 ————————
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.