Posts

Showing posts from April, 2018

SharePoint List View Cell formatting with CSR

Image
Client Side Rendering Client-side rendering is a new concept in SharePoint 2013. It allows you to use your own output format in a SharePoint page (list views, display, add and Edit forms). How to deploy the JSLink templates You can deploy those JSLink files in many ways. I describe in the samples below how to deploy JSLink files using OOTB techniques, but you can also use Script Editor or other techniques. Before proceeding , you have to upload the JavaScript code files on your SharePoint 2013 site. You can upload to any SharePoint document library, or _layouts folder, But in the below deployment steps I’m supposing you will upload the JSLink-Samples folder to the site collection Style Library. 1. Edit the List view page 2. Edit the List View webpart. 3. Go to List view web-part properties and add the JSLink file (~sitecollection/Style Library/<any subfolder>/jsfile.js) to JS link property under the Miscellaneous Tab. Remember- you have to hard code the ini

Simple Risk Assessment Matrix table with resultant risk calculation

Image
This post is not related to SharePoint and can be used in any web application with simple html and Jquery. I was preparing a risk matrix table for one of my projects and thought it is worth sharing it here. " A Risk Assessment Matrix is a project management tool that allows a quick view of the probable risks evaluated in terms of the likelihood or probability of the risk and the severity of the consequences. " . Let us build the below table. Once you have the page ready, you can calculate the resultant risk by passing the likelihood and the severity to the page using query-strings. For example your page is riskMatrix.html, then: http://mySitename/pages/riskMatrix.html?L=2&S=3 , so here Likelihood=3 and Severity=3, so the resultant risk is highlighted as M. Below is the complete code HTML, CSS and JS. Make sure you have referenced bootstrap and jquery (offline copy/CDN) in your page. <table class="table table-bordered table-responsive"

How to display more than 3 views in SharePoint List

Image
I have a SharePoint list with 5 Views, and there is a restriction that, by default only the top 3 views including the default view can be shown on the page. This quite annoying, if you need any other view, you will need to click on the 3 dots and select. Recently I had a requirement to display 5 Views on the SharePoint List page. After few mins of Google, I found the solution and I have modified as per my need. I hope someone is definitely in need of this solution, So thought of writing it here. 1. Simple solution: Open the List view page > Edit Page > Add Web part > Script Editor Webpart > Edit Snippet > Paste below code: <script type="text/javascript"> function renderHeaderTemplateForDocuments(renderCtx, fRenderHeaderColumnNames){     var viewData = eval(renderCtx.ListSchema.ViewSelectorPivotMenuOptions);     ClientPivotControl.prototype.SurfacedPivotCount = 5 ;        return RenderHeaderTemplate(renderCtx, fRenderHeaderColumnNames);