If MDS is enabled on that site you will need to use RegisterModuleInit()
to register your rendering script with the MDS engine so that it is consistently run.
To do that you will need to give a named entry point to your rendering script that you can use in RegisterModuleInit()
. So, your rendering script would have to change from:
(function() {
var overrideCtx = {};
// etc
// etc
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();
to
function myCustomRendering() {
var overrideCtx = {};
// etc
// etc
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
}
// register with MDS engine
// parameters are the URL/path of the script file, and the name of the function
RegisterModuleInit("/path/to/your/renderingScript.js", myCustomRendering);
// fallback for non-MDS sites, just call the function
myCustomRendering();
Here is a link to a blog post that explains it further.