1

I have a list in our implementation my company uses for recognizing efforts of individuals at the company. Anyone can add an item to this list. The fields they need to fill out are "Who they are recognizing" and "Why are they recognizing that person".

Currently, I have a site page created that pulls in that data via REST. On the site page I have a div tag with an id of container. My JavaScript/jQuery is appending code like this to my container for every list item:

<div class="recog">
  <div class="to"></div>
  <div class="message"></div>
</div>

In the same file, I have some CSS that's styling those classes. I wanted to add a button on the div that would allow users to like/unlike that specific recognition. Is this possible to do?

I was also messing around with rendering those divs using JSLink. Is it possible using JSLink?

Any help would be much appreciated!

0

JSLink is the technology to load extra JS files.

CSR (Client Side Rendering) is the technology of transforming SharePoint data into something else.

'DisplayTemplates' when your source is SearchResults. 'CSR' for ListViews


JSLinks can load any file (like jQuery from a CDN) , CSR files can be loaded without using JSLink..
But they usually exist and work together.


If you pull your current dataset with REST from a List, then it might be easier to go with CSR and change the ListView

Start on your current List with the Chrome Extension Andrei Markeev built:

https://github.com/andrei-markeev/cisar

It will start with a CSR template and do all the JSLink-ing for you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.