Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

JS-Link Problem

$
0
0

Hi,

i have a problem with a webpart in which i set the property of a JSLink. I want to change the display of 'SharePoint blog posts. The JavaScript is as follows:

(function () {

    var overrideCtx = {};

    overrideCtx.Templates = {};

    overrideCtx.Templates.Fields = {'Body':{'View': CBody}};

    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);

})();

function CBody(ctx) {

    var ret = ctx.CurrentItem.Body + "</br><a href="">Test</a>";

    return ret;

}

Thew problem is that it seems to work correct but only on the first request or after a refresh, for example when i request the page with the blogposts then the Link appeares in every post. When i klick on a blog title the in the blogpost the Link disappeares, then when i refresh the page the link appeares again.

What can i do to solve the problem?

Bye Arne


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>