Skip to main content
2 of 4
added 11 characters in body

I hope that you want to change a column header like following.

[![enter image description here][1]][1]

So you can accomplish it by using JsLink. Just override the OnPreRender like following

OnPreRender: function(ctx) {
    var fileName = ctx.ListSchema.Field[1];
    fileName.DisplayName = "File Name";
}

By above code I am changing the first column's header. So my after view is looking now like following

[![enter image description here][2]][2]

My full code is given below

SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function() {

  function getBaseHtml(ctx) {
    return SPClientTemplates["_defaultTemplates"].Fields.default.all.all[ctx.CurrentFieldSchema.FieldType][ctx.BaseViewID](ctx);
  }

  function init() {

    SPClientTemplates.TemplateManager.RegisterTemplateOverrides({

       OnPreRender: function(ctx) { 
       var fileName = ctx.ListSchema.Field[1];
      fileName.DisplayName = "File Name";
       },

      Templates: {

      //     View: function(ctx) { return ""; },
      //     Header: function(ctx) { return ""; },
      //     Body: function(ctx) { return ""; },
      //     Group: function(ctx) { return ""; },
      //     Item: function(ctx) { return ""; },
      //     Fields: {
      //         "<field internal name>": {
      //             View: function(ctx) { return ""; },
      //             EditForm: function(ctx) { return ""; },
      //             DisplayForm: function(ctx) { return ""; },
      //             NewForm: function(ctx) { return ""; }
      //         }
      //     },
      //     Footer: function(ctx) { return ""; }

      },

      // OnPostRender: function(ctx) { },

      ListTemplateType: 101

    });
  }

  RegisterModuleInit(SPClientTemplates.Utility.ReplaceUrlTokens("~siteCollection/Style Library/change-title.js"), init);
  init();

});

I asked you a question in comment but you did not bother to reply. JsLink is only available is SharePoint 2013. [1]: https://i.sstatic.net/TY0s3.png [2]: https://i.sstatic.net/a7Bhu.png