Questions tagged [client-side-rendering]

Client Side Rendering in general is a technique to offload part of the HTML content rendering workload from server side to the client's browser. In SharePoint 2013 JavaScript-based CSR templates partly replaced XSLT (remember, you can still switch to server rendering in web part properties).

Filter by
Sorted by
Tagged with
1
vote
3answers
1k views

How to get ClientContext in CSR?

In a document library's /Forms/AllItems.aspx, I am trying to render a column from ID to a file URL (FileLeafRef). However this line of code: clientContext = new SP.ClientContext.get_current(); ...
0
votes
2answers
52 views

Is there a way to share common CSR across site collections?

I have some Javascript/CSR that is used on multiple site collections. Is there a way to share this across site collections instead of having the same code published in multiple sites?
0
votes
1answer
977 views

Color a cell based on content in list

I am a JavaScript and SharePoint novice. I would like to change the cell color based on contents using Client Side Rendering and JavaScript. I have had good luck with changing rows with you fine ...
0
votes
1answer
517 views

Change row color according to status field

I have the following code. I'm trying to change row background colors based on the status field. But it is not working. SPClientTemplates.TemplateManager.RegisterTemplateOverrides({ OnPostRender: ...
2
votes
1answer
336 views

Color Row if Date in column = Sysdate in SharePoint Foundation 2013 using CSR

I´m using a List with about 400 Rows, for each day one. Now i want to color each row where the Date is a Day of Weekend (Sat & Sun). This Part is wokring fine with this JS var statusColors = { '...
0
votes
1answer
651 views

JSLink OnPreRender

I am facing a problem while using OnPreRender and Item events. According to my requirement I have to read a specific permission from a list. I use OnPreRender even to do that, once I do that I ...
0
votes
1answer
672 views

JS Link and CSR: Error After Filtering and Viewing/Editing

I have a *.js to color code my rows according to the value of the column Status. It is working very fine UNLESS one filters any column and views/edits an item. After exiting the item view, the ...
1
vote
1answer
678 views

CSR: ScriptLink/Custom Action CDN Libraries load after JSLinked files are loaded

I am almost to 2.0 with the generic iCSR support library. Having some issues with deployment: Adding the library as SiteCollection ScriptLink/Custom action loads it before msajaxbundle where Type....
3
votes
0answers
1k views

CSR: RegisterModuleInit without hardcoded JS filename?

Always looking to make CSR development easier... This the typical CSR programming pattern: We hardcode the filename inside the CSR file SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", ...
1
vote
1answer
946 views

CSR: Run code once (in OnPostRender) for none CSR stuff, StateInitDone?

I found so little info on StateInitDone out there I would like some confirmation. I have code in the CSR OnPostRender which creates (non-CSR) DOM elements (easter-eggs) on screen; I have dealt with ...
4
votes
1answer
749 views

CSR + MDS, where are my globals going?? (and I want them back!)

Disclaimer I am working on an edge case here. The Javascript file is dynamically created server-side, and the JSLinks all point to the same absolute URL (receiving different content). JSLink Absolute ...
1
vote
0answers
81 views

CSR: Group header returns different result after an AJAXRefreshView

I do not touch the grouping in my CSR template at all On Page load the View grouping looks like the standard 2010 style Before: Action: Setting a choice triggers an AJAXRefreshView (so the exact ...
6
votes
1answer
969 views

SharePoint CSR Conditional Formatting is working but row highlighting is not

I was testing the flexibility of CSR and came across a problem which i am not able to resolve . I have created a list which contains product details like Total Sales and Sales Target . I am trying to ...
2
votes
0answers
266 views

CSR: can SP.ClientContext be used in OnPostRender?

Seems like SP.ClientContext is not yet ready in the OnPostRender function I could add a delay, but would like to update some List content in the OnPostRender I get a TypeError: Cannot read ...
6
votes
1answer
2k views

what are the differences between JSLINK and Client Side rendering in SharePoint Server 2013

I have read many articles about client side rendering & JSLINKs but i am unable to differentiate between these two topics. now I have used JSLINK to implement 2 things inside my SharePoint server:-...
4
votes
0answers
242 views

are JSLinks on WebPart , View , Fields mutually exclusive?

Elio Struyf already blogged in 2013 about a problem with missing Microsoft CSR Templates when you add a JSLink on the webpart. The checkboxes (from hierarchytaskslist.js) do not display. Seems that ...
1
vote
2answers
1k views

show Doc icon of SharePoint document library using jquery in jqgrid

My scenario is to show doc icon in Jquery Grid for sharepoint document library. My Data is in JSON. here is how i am fetching the data and building the array object and Pass it to JSON.Now in my ...
2
votes
1answer
327 views

Will I overwrite or append existing form field validators with registerClientValidators?

I am a bit confused with the right way of registering custom CSR callbacks for fields on a list form. While things are pretty straightforward if I am developing a totally custom field control, I am ...
6
votes
1answer
417 views

(ClientSide) set/update JSlink to CSR files for (all) WebParts, Views, Fields

Working on iCSR.github.io to make CSR development a bit easier. I now want to make it as easy as possible to set the JSlink connections on WebParts, Views or Fields. I have code snippets to do it ...
3
votes
0answers
473 views

CSR ListView Pagination working in IE but not in Chrome

I've created the following to override a ListView I'm using to display an Announcements List to users. This works in IE9, enabling 'Asynchronous Update' has no effect on the results. In other versions ...
2
votes
3answers
1k views

Changing A Lists row color based on a number

So I have a calculated field in my List view that gives the number of days from the contract end date - current date. I wrote the following script to change the color of the row if less then 90 or ...
3
votes
2answers
1k views

SharePoint Online List view webpart client side rendering (CSR) issue while trying to hide items

In SharePoint 2013/SharePoint online using client side rendering (CSR), I am trying to remove rows from List view webpart (LVWP). I am using OnPreRender event of CSR as below:- (function () { var ...
1
vote
1answer
388 views

SPField_FormDisplay_Default is not defined

I have set JSLink to a field (LinkFilename) that required to return default rendering in some context. I implementation according PnP/ReadOnlySPControls.js, and use SPField_FormDisplay_Default to ...
2
votes
2answers
631 views

Generate default “Name Column” fields values in JSlink (CSR)

I am having issues with "Name column" and its fields in libraries. I would like to iterate throuch each item and return default render value in this column in certain cases. I have tried lot of things ...
2
votes
0answers
35 views

Store data in the list - save it to list itsef for CSR to read

I would like to ask if somebody has an idea how I can store formatting data for particular list/webpart on a page. My concept: I would like to create JSlink that would be attached in masterpage file. ...
8
votes
2answers
3k views

What are the Type.registerNamespace advantages over standard JavaScript methods?

Now I dive deeper into the world of .Net developers I notice more and more Microsoft ways of doing things unfamilair to me as a (once LiveScript) JavaScript developer. I see PnP and other blogs using:...
0
votes
2answers
158 views

Client Side Rendering deployable via Sharepoint solution package

I would like to create a sharepoint 2013 solution (.wsp) that could be easily deployed and would contain a basic CSR(JSlink) that would modify all views in the site collection. I have been able to ...
1
vote
3answers
946 views

How can I convert the format ctx.CurrentItem.Created

I am using SP2013 on-premise. I have applied client side rendering to convert the Item created datetime to specific format. The problem is "ctx.CurrentItem.Created" always return a string format as ...
6
votes
3answers
4k views

JSLink - Client side rendering -How to render custom display name with ICON in the list view?

I have been playing with JSlink and CSR. I was able to modify headers in my table with this code: (function () { function preTaskFormRenderer(renderCtx) { modifyHeaderData(renderCtx); } ...
1
vote
1answer
1k views

Get Collection of Field Value in Client Side Rendering

I would like to get collection field value using CSR/JSLink.Below code is iterating value of the particular column.But,in my scenario i needed to get whole collection. <script type="text/...
3
votes
1answer
390 views

Remove filter control in column using Client-Side-Rendering

Background: I have a listview 1 and I'm using CSR for set specific rows with Hyperlinks and hide only a column (called Id with InternalName Id0) in the OnPreRender > Templates. Here is the code ...
7
votes
3answers
999 views

CSR can not be applied to Personal Views?

I just posted this on Andrei Markeev his Cisar issue list. Can someone confirm CSR can not be applied to Personal Views, or tell me I am talking poop (je praat poep! in Dutch) BTW anyone doing ...
1
vote
1answer
511 views

CSR Documentation [duplicate]

I am looking for CSR Documentation. If I Google something from the Server-Side API, I get the documentation right away. For example, Googling SPWeb, the first result is the documentation: https:/...
1
vote
1answer
1k views

Using JSLink to recreate the default view

I would like to learn how to completely override a list's view and recreate it using JSLink, if such a thing is possible. There appears to be a huge gap between the types of alterations I can make: "...
1
vote
1answer
763 views

How to change the sorting order in view selector? [duplicate]

On a document library (under SP2013) we have created multiple views. In the view selector, the default view is listed at leftmost. All the other views are sorted in alphabetical order based on the ...
0
votes
1answer
856 views

Apply JSLink client side rendering to Content Query Web Part

We are using SP2013 on-premise standard edition (hence content search web part is not supported). I have applied custom rending by inserting a JSLink to some list view. Later I need to apply the same ...
2
votes
1answer
578 views

Customising Announcements view with CSR

I'm a 10yr+ web developer with plenty of experience in C# / ASP .NET, but still very new to SharePoint. I've been trying to create a custom view for the Announcements web part in SharePoint Online (...
4
votes
2answers
2k views

List Web Part CSR issues when sorting/filtering

I'm experiencing an odd behavior using the Client Side Rendering (CSR) functionality of SharePoint 2013, with a standard List Web Part (LWP). Here the js code (referenced using the JSLink property of ...
2
votes
2answers
517 views

CSR will only be executed after reloading the page

I have the folloing definition in my schema.xml <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" SetupPath="pages\...
1
vote
1answer
432 views

SharePoint CSR using JQuery

Good day all, I have been trying to wrap my head around SharePoint CSR. I have been fairly successful with using javascript to modify the list view. However, I have been trying to use the following ...
2
votes
2answers
1k views

Prerender executing twice

I have some prerender code that is being used to get information from another list to add into the display of the main list. I am puzzled - the prerender code executes twice. (function () { var ...
0
votes
1answer
759 views

Attachments in CSR list form [closed]

I have customized my page using CSR list form . How to display attachment in the edit and display form?
2
votes
0answers
72 views

CSR - One function for every field in a View?

We all know how to define one template function for one field. SPClientTemplates.TemplateManager.RegisterTemplateOverrides({ Templates: { Fields: { "[fieldname]": { ...
2
votes
2answers
3k views

How can I color code sharepoint list group titles?

I've recently been messing around with CSR for highlighting sharepoint rows based on the text that they contain (used http://www.c-sharpcorner.com/UploadFile/sagarp/sharepoint-2013-list-column-status-...
6
votes
2answers
3k views

Null Reference Type Error using Javascript in Sharepoint 2013

Having an issue with javascript in sharepoint 2013. We have set up javascript and it is working by changing the colours of the rows in a task list. The issue is when the user goes into quick edit, and ...
1
vote
2answers
716 views

How to get logged in username in custom display template for CSWP using CSR

I am using a custom display template for Content search web part. I am able to get currentItem's properties but how to get logged in user's username using client slide rendering.
4
votes
2answers
3k views

Targeting specific list with Client-side rendering

I've read several walkthroughs on client-side rendering (CSR) and JSlink, and the methods to target only one list on a page instead of all lists. I understand that I can target using two things: ...
10
votes
1answer
433 views

Not able to set jslink property for a field without FullControl permisson on web (sponline)

For my SharePoint Hosted App, I set the jslink property of the field for customized rendering (JSOM set_jsLink). This used to work without having FullControl permission on web earlier. However, now ...
0
votes
1answer
445 views

Automatically collect WEBPARTID for rendering CSR (js-link) and paste them into a script JS

I am working on a rendering solution CSR (JS-Link) which uses the webpart ID list view to render. Rendering a JS file is located in a library on the site. The site is then registered model and ...
0
votes
3answers
772 views

rendering, spservices and view title header counts

For my sharepoint list, I have several views, which all reflect the same basic list, but with different filters. I am wanting to render the header section of this page, and to suffix each view header ...