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

Client Side Rendering using Javascript only works once

$
0
0

Hi all,

I am using SharePoint 2013 Foundation and try to customize the rendering of a field in the default list view. For development i use Visual Studio 2012 and created a sandboxed solution; this solution includes a column named "MCMediafolderLink" and is defined as follows:

<?xml version="1.0" encoding="utf-8"?><Elements xmlns="http://schemas.microsoft.com/sharepoint/">  <Field
       ID="{e1a2cc44-ce4d-4e28-9a54-baaa50890648}"
       Name="MCMediafolderLink"
       DisplayName="$Resources:Reply.MetaCatalog.Columns,MCMediafolderLink_DisplayName"
       Type="Text"
       Required="FALSE"
       ReadOnly="FALSE"
       JSLink="~site/_catalogs/masterpage/CustomScript/field.js"
       Group="$Resources:Reply.MetaCatalog.Columns,MCItem_Group"></Field></Elements>

The JavaScript in field.js at the moment looks like this

(function () {
    var ctx = {};

    ctx.Templates = {};
    ctx.Templates.Fields = {
        'MCMediafolderLink': {
            'View': 'Hello World'
        }
    };
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(ctx);

})();
As i understand it the output in the list should always be "Hello World" for the MCMediafolderLink field. The problem is this works only once.

Hello World is only showed when i reload the page completly; every time i navigate within the page and XHR is used to load the content the field show its original value and not my override.

Any thoughts on this would be great!

Thx!

[UPDATE] As i suspected turning off the "Minimal Download Strategy" site feature fixes the problem; so i assume it's a bug?

Viewing all articles
Browse latest Browse all 25064

Latest Images

Trending Articles



Latest Images