Following is the setup.

  1. Have a custom list item with rating enabled
  2. Type of rating is "Like" so user can like or unlike the list item
  3. Have a page where the the list view is shown in the list view webpart.

What I would like to know is, how can I use JSLink to add my own condition to the "like" action or override "like" action?

I have been searching here with tag JSLink, but seems like none is there with my particular requirement.

  • If an answer was helpful could you remove your question from the SO unanswered list, by marking it as answered, tnx – Danny '365CSI' Engelman Jun 4 '17 at 7:56

JSLink is the technology to load JavaScript files, most often you load a CSR (Client Side Rendering) JS file.

So the terms JSLink/CSR are used interchangeably

In your scenario it is not CSR code (where you override how Fields/Views are displayed)

It seems like you want to hook into SharePoint generated content.

So you have to add JavaScript (loaded by JSLink) which removes the EventListener on the Like button with your own

document.addEventListener( .....

  • Thanks Danny, I did a small POC. Following seems to be possible. 1. Use template override for Field 2. Add necessary code to show custom button with count 3. Attach custom event to the custom button 4. Send like or dislike requests through REST when user presses the button. – Kannan May 15 '17 at 4:38

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.