Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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).

0
votes
0answers
21 views

How to hide/show view columns in SharePoint list view

I am playing with Document Set in SharePoint where document set's documents takes default view. However, I dont want to show few columns (e.g. 'Status', 'Salary' etc.) in default view but want to ...
0
votes
1answer
39 views

Color code the SharePoint list column value based on a condition?

I know this question has been asked and answered but I am new to CSR and I do not even know how to begin to implement this solution. I have tried to use the solution at this link with no success. ...
1
vote
1answer
60 views

PreSaveAction for Quick Edit Mode

I have build some scripts running in the PreSaveAction function for example to validate some data or conditionaly send an email via ajax call. Now I need this functionality when the user creates a new ...
0
votes
1answer
36 views

Adding a new control in New/Edit form using CSR display templates

I am planning to attach a attachment control in my newform and edit form using CSR display templates. i was able to add the control in the page but it is repeating (screenshot for the same). How can i ...
0
votes
2answers
60 views

Attachment Control in Newform and Edit form of a list Using Jquery

Has any one tried inserting Attachment control in Newform and Display form using Jquery with out going for Custom forms from Designer. I know we can add an attachment control through designer. When i ...
1
vote
1answer
38 views

SharePoint Online, JSOM, 'ObjectSharingInformation is not defined'

How do You use ObjectSharingInformation in javscript? I get Uncaught ReferenceError: ObjectSharingInformation is not defined My function is something like function getSharingDetails() { ...
1
vote
1answer
67 views

SharePoint Online CSR, make clickable link in Datasheet View

Want to create direct link to Document Set folders, so found and changed CSR that do this. Works well, but not in Datasheet View (it is not clickable in Datasheet View). Tried to change column types ...
1
vote
0answers
23 views

Custom Web part with filter that doesn't cause postback

I have a custom Content Query Web Part that currently pulls in events into a custom calendar, by month, with selectable filters that filter event listed on the calendar by a field value on the Event ...
0
votes
1answer
37 views

CSR to change item link for certain file types

First off, I am rather new to CSR so I apologize for anything stupid to come! This is Sharepoint Online. I'm trying to use CSR, on a custom page with a filter and list view web part (doc library), ...
0
votes
0answers
37 views

CSR Render mode on list item editform.aspx; some fields get saved, other don't

I have an OOTB list item form that I'm injecting javascript into that doesn't save all data; some fields get saved and others are not saved (i.e. the modifications in editform.aspx don't all get saved)...
0
votes
1answer
26 views

CSR and XSLRender flag in custom `SPField`s

I'm trying to understand what the XSLRender flag in the SharePoint-Enterprises CSR stands for, did not find anything on the web. Does anybody have an idea/explanation? Where does it come from? EDIT: ...
1
vote
0answers
21 views

Issues with trying to hide a column with JS Link in multiple webparts on the same page

I found a solution in the below post to hiding columns using JS link. However, I have multiple webparts on a page with different views of the same list and it is only hiding the columns in the first ...
1
vote
0answers
32 views

Display webpart side to side on DispForm / EditForm

I have edited my disp and edit form from a list to display a second webpart inside (parent-child list) and they are, as usual, displayed one above the other. I would like to have them side by side. ...
1
vote
1answer
46 views

Running custom function before SharePoint renders page

Some Background I have a publishing site that presents documents with stylized icons using some custom display templates and views (with CSR). Document icons are rendered using fontAwesome classes ...
0
votes
1answer
70 views

JSLink code to filter lookup columns work on a Custom list's new and edit item form but not on document library edit item form

I am using JSLink code to filter lookup column to show relevant values. The same code works well on a custom list's edit form but breaks on the document library's edit form. I checked the ID of lookup ...
0
votes
1answer
108 views

Sharepoint Online: Display publishing image and created by fields in dispform.aspx via csr

I've applied a csr js file to overwrite the rendering of dispform.aspx for a simple list. This displays every field correctly except for a publishing image and the created by fields which return "...
0
votes
1answer
61 views

SPClientTemplates.TemplateManager.RegisterTemplateOverrides does not run first time in IE, works on refresh

So I have some JS that is supposed to take a related list, remove the ID column, auto-populate it, remove the hero links, and remove the add column button. In Chrome and Edge, it executes this ...
1
vote
1answer
98 views

Modifiy the value of a choice field with javascript

I am writing a code which tests the due date of my task and then the value of my column "emailcheck". This last one is a Yes/No column, by Default set on No, I will need it in to know if I sent or not ...
0
votes
0answers
32 views

Is it possible to modify more than one list views of SAME LIST in a page through CSR (JSlink)?

Following this article My (custom code) Demochart.js is this: // Declare the variables. var sitesChart = sitesChart || {}; sitesChart.Colors = ['#1BA1E2', '#E51400', '#339933','#56348E']; ...
1
vote
1answer
186 views

Two list views of same list in a Page. Applying JS link - CSR to create charts using Charts.js

Following this Article Scenario: To create charts. Using chart.js + jquery + Demochart.js file I have modified using the one given in article. I have two list view webparts in same page. So I apply ...
0
votes
0answers
74 views

asp:UpdatePanel to avoid refresh not working

I have added asp:UpdatePanel in my SharePoint page to avoid refreshing the page. But page still refreshes on button click. Any suggestions? <asp:UpdatePanel ID="updatePanel2" runat="server" ...
0
votes
1answer
70 views

Clear radiobutton list selection using jquery

I would like to clear Radiobutton list selection once user click the button. I have tried the following code but clears the selection in browser. When I access from backend(C#) selection is there. It ...
0
votes
1answer
255 views

How do I enable CSR to return the default rendering for a Select column in a list view web part that provides filter values to other list web parts?

I'm attempting to override the rendering of a Select column in a list web part that provides filter values to another list web part. In the code below, I'm attempting to not display the Selector icon ...
1
vote
1answer
250 views

How to use Sharepoint CSR to conditional hide row

Team, I've got a list to record a shift roster. I have two Date/Time columns recording (1) Start of the shift and (2) End of the Shift. I want a view that only shows who is rostered on right now! I ...
3
votes
2answers
43 views

How do I load user's data before JSLink renders the form

Below is my simple code to render the "Activitydescription" field in the newform.aspx. This is working. (function () { var ActivitiesListContext = {}; ActivitiesListContext.Templates = {}; ...
1
vote
1answer
47 views

Adding a SP.FieldUserValue into the Visitor/Member/Owner group of a site

I'm creating a website based on what a user submits in a form 3 fields are reserved for the 3 types of default groups that you're asked for when creating a subsite manually : - Owner - Members - ...
1
vote
1answer
279 views

Need help changing cell background color based on the content of the cell using CSR

Here is a link to what I'm trying to do: Sharepoint CSR JSLink – View Cell Customization. It's my understanding that it should work basically as is with only minor updates to the switch to fit my ...
0
votes
2answers
54 views

Javascript in CSR, Slice & Substr

I have the below function,which colors Title column in SP Online. I want to extract just the last 2 characters from "Period" and use it in the Switch case. I tried Slice,Substr function but both didn'...
0
votes
2answers
542 views

Conditionally hide a metadata field based on user's permission

I am working on an office 365 online SharePoint site collection. I have added a custom list inside my site collection. The site collection has the built-in group named "Owner", so is there a way ...
2
votes
1answer
133 views

Customize Launch Behavior Choice Options

In SharePoint 2016 Promoted Links in Launch Behavior column I wanted only 'page navigation' and 'New tab' options. So I removed the 'Dialog' option from choice. After this I added items in the ...
1
vote
0answers
70 views

How to focus to a web part in page

I have a task to zoom in to a web part in mobile device. Our master page and page layout isn't mobile ready, but we provide users access to some SharePoint pages. I tried to use this to focus (or ...
0
votes
1answer
881 views

Color code sharepoint Online calendar view [duplicate]

I have a custom list in which i have created a calendar view. I want to color the calendar items based on a choice column. In SP2010, I had a JavaScript doing this but in SP Online, I am not able to ...
0
votes
1answer
47 views

Overriding text in datatable with icons

In reference to this page, I'm trying to replace the text with icons but not getting the desired results. function mySuccessHandler(data) { try { var dataTableExample = $('#table_id').DataTable();...
1
vote
2answers
246 views

SharePoint List: Modify text color based on choice in list view

List Item: Choice - Selection I'd like to change the text color based on the selection. For Example. Column Name Red (choice 1, red txt) Blue (Choice 2, blue txt) Yellow (choice 3, yellow ...
0
votes
1answer
324 views

How to use JSLink (CSR) for multiple views of same list in Same Page?

I have a page with 2 views of same list. When I use the JSLink to render one of the column (request_id) which is present in both the views, in one view JSLink is working fine, but on the second view ...
2
votes
2answers
2k views

Get full user details from person field in javascript

How do I get the "User Information" for a specified user using JSLink? With CSR, I can get some user details from ctx.CurrentItem.PersonField[0]. This gives me an array of users which are selected ...
2
votes
1answer
270 views

How to add SPFx client side webpart to MasterPage

I have a webpart that is developed using SharePoint Framework. This wepart should appear across the pages in the site collection. I know that we can add server side webparts in master page. How can we ...
1
vote
1answer
147 views

Get title for list in csr file attached via jslink?

I need to get the list name (or title) the user is currently viewing to complete a url. I'm good with ctx.Currentitem references but no idea how to get list data like "title". Need something like ...
0
votes
3answers
347 views

How to display additional fields from Lookup table with JsLink

I have a list (Jobs) with a lookup field (Market) to another list (Markets) which contain the Market details (city,state,zip). In the View display, I want to show the Market name from Jobs as well as ...
0
votes
2answers
114 views

Quick edit list table row has no id, only iid, how do i find the element?

I'm trying to add conditional formatting to my list, but when i enter quick edit, my code wont work because it uses the id on the table row to change the color and for some reason the table rows in ...
0
votes
1answer
62 views

Hide list items based on results from another list (limited options)

Team, I have a very restricted Sharepoint environment; no access to designer no access to Filter webparts workflows limited to (1) Approval (2) Collect Feedback (3) Collect Signatures (4) Three-...
0
votes
1answer
52 views

CSR list animation removes formatting, any way to keep both?

I have been struggling with keeping the formatting on my list. When i filter, search, or sort, my formatting is removed from the affected rows. After some googling i found a solution; removing the ...
1
vote
1answer
264 views

SharePoint CSR causes an error on the list view

I am having the following problem. I wrote a custom JavaScript to color list view rows using the OnPostRender event. It works fine and all until the following steps are executed: Open the list view (...
1
vote
3answers
909 views

jQuery not working on dynamically loaded content

Newbie here looking for advice. I've looked through a ton of items similar to this and nothing is solving my problem. Some of my jQuery is working, some is not. I assumed it was due to the order I was ...
0
votes
1answer
84 views

Ribbon not initially rendered when using CSR in conjuction with React and TypeScript

we have designed a few custom fields using CSR, TypeScript and React. On our AllItems.aspx, we use this to render a link for a "cross-site" lookup field which is really just a text field holding a ...
1
vote
0answers
102 views

How to display event dates with optional times in WebPart

In our Events web part we want to display Start & End dates for Calendar events. Some of our events are multi-day and probably have a midnight time, and these we want to display like so: e.g. 29 ...
5
votes
2answers
718 views

sp.js and sp.init.js not loaded on Edit form in time for client side rendering

We have two different lists that we are setting up some jslink client-side rendering files for their edit forms. Both csr files use the SP.Guid.newGuid() function to id some DOM elements in the markup....
2
votes
0answers
57 views

Custom Form Rendering RegisterTemplateOverrides in a promise issue

Using custom form rendering with JSLink, I fetch some data in promises before I attempt to do: SPClientTemplates.TemplateManager.RegisterTemplateOverrides(context); However because some of the ...
0
votes
1answer
397 views

Set current date time in datetime field using JSLINK CSR

Using CSR I am able to set value of date field, but for time field it's not working. following code works for date field without time: ctx.CurrentFieldValue = "01/01/2015"; return ...
2
votes
1answer
107 views

createListItem with SP.ClientContext in for each loop

we use a custom aspx page in SharePoint 2013 to create list items in a for each loop via sp.js - works fine! function PushValuesToList(results) { results.forEach(function(entry) { SP.SOD....