Is it possible to use the "ShowInGrid=True" element of the URL to act as a trigger for show/hiding a field in a datasheet view?
The below code that will hide it nicely on the default allitems view but i would like that to be field to be visible on the quickedit view.
(function () {
function RemoveFields(ctx) {
var fieldName = "Date"; // here Date is field or column name to be hide
var header = document.querySelectorAll("[displayname=" + fieldName + "]")[0].parentNode;
var index = [].slice.call(header.parentNode.children).indexOf(header) + 1;
header.style.display = "none";
for (var i = 0, cells = document.querySelectorAll("td:nth-child(" + index + ")"); i < cells.length; i++) {
cells[i].style.display = "none";
}
}
function registerRenderer() {
var ctxForm = {};
ctxForm.Templates = {};
ctxForm.OnPostRender = RemoveFields;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(ctxForm);
}
ExecuteOrDelayUntilScriptLoaded(registerRenderer, 'clienttemplates.js');
(Source https://riptutorial.com/sharepoint/example/26699/hide-column-from-sharepoint-list-view-using-csr-)
If hiding is not an option can the field be obfuscated/md5'd instead on the list view?
I can see how other examples on the non quick edit views will work by highlighting the form and using the ("NewForm": hideField) notation (from Dylan Christy) but getting it to appear for quick edit is causing me problems
Thanks in advance