Quantcast
Viewing all articles
Browse latest Browse all 26374

Sharepoint 2013 refresh custom task list after sorting

Hey,

I'm using jsLink to manipulate rendering of the list elements in SP2013.

It seems fine, as I was able to change each item display, adding colors, some borders to each one of them etc.

I did it using code below in JS file rendering it (important fragments presented):

(function () {
    var overrideCtx = {};
    overrideCtx.Templates = {};

    overrideCtx.Templates.Item = window.sth.customItem.customItemHtml; // customItemHtml defined somewhere else, only concatenating html tags with ctx.CurrentItem.Title value

    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();

The thing is that after overriding Item element (using: overrideCtx.Templates.Item = ...), the list of items is not being refreshed once I click on any particular column to sort the rows ascending/descending.

The HTTP call is triggered once I click the column name to sort it and the proper response is provided as a result of that call. Still, the list is not refreshed and it remains same like after the page initial load.

I'm guessing that after overriding Item element I'm losing some callback function definition that is doing the list elements refresh. But not sure how I should solve it...

Was thinking about using overrideCtx.OnPreRender and overrideCtx.OnPostRender, but not sure what should I put inside...

Please let me know how should I proceed. Thanks!


Viewing all articles
Browse latest Browse all 26374

Trending Articles