Last active
June 26, 2017 16:24
-
-
Save ChrisRomp/3196b6c0bc93b442dc0d4a86a525c60e to your computer and use it in GitHub Desktop.
SharePoint JSLink/CSR to Override New Item Toolbar Link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | |
ctx.newFormUrl = "https://microsoft.com"; | |
}, | |
ListTemplateType: 100 | |
}); | |
} | |
RegisterModuleInit(SPClientTemplates.Utility.ReplaceUrlTokens("~siteCollection/Style Library/JSLink_NewLinkOverride.js"), init); | |
init(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment