I'm experiencing an odd behavior using the Client Side Rendering (CSR) functionality of SharePoint 2013, with a standard List Web Part (LWP).
Here the js code (referenced using the JSLink property of the LWP):
(function () {
var ctx = {};
ctx.Templates = {};
ctx.OnPostRender = [];
ctx.OnPostRender.push(function() {
console.log("Post rendering...");
LoadMyCallouts();
})
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(ctx);
})();
My custom function "LoadMyCallouts" uses callout.js to attach a callout on the row elements of the LWP. The callout will be open on clicking a row in the LWP.
On page load, all is working fine: all callouts are created successfully and I can easily test it by clicking on each view rows and seeing the callout opening.
The odd behavior starts when I sort a field on the LWP or just filter by a field. From console log I can see that "LoadMyCallouts" is correctly executed, but I can't get displayed anymore the callout on row click event.
In particular, the view loses all row callouts after sorting. While after filtering, the LWP loses only the callouts of the filtered elements. When clearing the filter I'm still able to display the callout of the rows, except those previously filtered.
Please share you experiences.
Thank you.