Posts

Showing posts from June, 2015

SharePoint 2013 - Use JSLink to Create Custom Field Type

Image
One of the things that we used to be able to do with server farm solution is to create custom field type and custom field type control.  With the App Model approach, we'll need an alternative way to give us the custom form that we need. SharePoint is using JSLink for a lot of displaying option.  You can specify a JavaScript to be used in a  web part or for a field.  The example below shows how you can create custom displaying field.  The example do the following: It customize the displaying of the Is Separator field to add onclick event handling if the URL field is the default value, it sets the default value for both the URL and the description text box Sample form Below is the JavaScript sample code and I saved it in isSeparator.js //IsSeparator Display (function () {     // Create object that have the context information about the field that we want to change it's output render     var isSeparatorFieldCtx = {};     isSeparatorFieldCtx.Templates =