I have SharePoint on-premises 2013, where inside some site collections, I define JSLINKs as follow, to disable site columns inside the quick edit grids:-
(function () { var overrideContext = {}; overrideContext.Templates = overrideContext.Templates || {}; overrideContext.Templates.OnPreRender = function(ctx) { var statusField = ctx.ListSchema.Field.filter(function(f) { return f.Name === 'ItemNumber'; }); if (statusField.length>0) { statusField[0].AllowGridEditing = false; } } SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideContext); })();
then I associate the site columns with the above JSLINK using this PowerShell:
$ web = Get-SPWeb http://~******/ $ field = $ web.Fields["Item Number"] $ field.JSLink = "~siteCollection/Style Library/JS/HideItemNumberInQuickEdit.js" $ field.update($ true)
now I have migrated my site collections from SharePoint 2013 on-premises to office 365, using a third part tool. but I have noted that the site columns were enabled inside the quick grid edit, inside SP online. so I am not sure, if there is a way to reassign the jslink to my online sitecolumns? of course the JSLINK file HideItemNumberInQuickEdit.js
itself were migrated correctly.
second question. if I manage to re-assign the JSLINK, then will my above JSLINK be able to disable the site column inside the quick edit grid even on the modern user interface inside SharePoint 365?
thanks