A2ZDinesh
A2ZDinesh

Reputation: 125

SharePoint 2013 JSLink Not working on LinkTitle Column

When I applied JSlink for LinkTitle Column I am not able to see the JS is loading at all. But all for other Columns and my custom columns too I can apply.

Is their any difference over here..Please help me asap..

Upvotes: 1

Views: 2326

Answers (2)

pierrebo
pierrebo

Reputation: 924

This kind of answer the question, but you need to modify all the List Views to apply it.

I have been able to change the LinkTitle site column jslink, and the result is there:

<d:JSLink>~sitecollection/umaAssets/project-card/assets/jslink/task-title.js</d:JSLink>

but when I create a list using this column, the list column has a jslink of null:

<d:JSLink m:null="true"/>

There seems to be no correlation between the two.

Upvotes: 1

Vadim Gremyachev
Vadim Gremyachev

Reputation: 59358

How to customize field rendering in List View (SharePoint 2013)

Below is demonstrated how to customize LinkTitle column rendering

1) Create template

(function () {


   function titleRenderer(ctx) {
       var item = ctx.CurrentItem;
       return '<img src="/SiteAssets/' +  item.Title + '.png" />';  
    }



    function registerRenderer()
    {
      var context = {};
      context.Templates = {};
      context.Templates.Fields = {
        "LinkTitle": {
            "View": titleRenderer
        }
      };

      SPClientTemplates.TemplateManager.RegisterTemplateOverrides(context);
    } 
    ExecuteOrDelayUntilScriptLoaded(registerRenderer, 'clienttemplates.js');

})();

where we override LinkTitle field rendering

2) Upload template file into, for example, Site Assets library

3) Specify JS Link property for List View web part Example: ~site/SiteAssets/Phones.js

enter image description here

Upvotes: 1

Related Questions