5

I'd like to use AddPostRenderCallback in my SharePoint 2013 Display Template like this:

<!--#_
   AddPostRenderCallback(ctx, function(){
       alert(ctx.Title + "finished rendering!");
   });
_#-->

However, the ctx.Title doesn't exist, and ctx.CurrentItem is null. What could be causing this? This is normal Content Search Web Part and I'm displaying blog articles, and in general the results work just fine.

enter image description here

1 Answer 1

4

Isn't current item null since the generation of the list items is already done when PostRenderCallback is called.

That should mean that ctx is now only containing information about the list as so and not about a specific list item.

1
  • Had totally forgotten this question, but your answer seems to make sense, so marking it as answer. Thanks! Can't remember how I worked around this issue, though.
    – Jussi Palo
    Feb 28, 2014 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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