Skip to main content
4 of 4
replaced http://sharepoint.stackexchange.com/ with https://sharepoint.stackexchange.com/

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

enter image description here

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

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.

For SharePoint 2010 see here