Does anybody know how to catch paging event in javascript? I need to add some markup before paging buttons, but this webpart is loaded dynamically. Tried to review "Item_TwoLines.html" Display Template but as I see it renders only <li></li> elements but I need to modify header with paging buttons

There is CSR for Search Content webparts as I understand, so I can't catch OnPostRender..

Here is html that I'm adding dynamically (in _spBodyOnLoadFunctionNames.push()). After paging my header dissappears. I need to re-add it every time paging fires and search results loaded:

enter image description here

Here is out-of-the-box webpart header:

enter image description here


Ok, headers stays in another template, "Control_ListWithPaging.html". Added my html there and all worked.

Related to events - there is something in this post: AddPostRenderCallback in ItemTemplate is not getting called in Sharepoint Online

But as I understand You have no access to page elements from inside this display template. Maybe I am wrong, not sure

  • NB! Always make and modify copy, not original template files.
    – Gennady G
    Aug 8 '19 at 12:18

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.