0

subj

no workarounds?

"use strict";

var defaultSubtypeLookupFieldTemplate = SPClientTemplates._defaultTemplates.Fields.default.all.all.Lookup.NewForm;

SPClientTemplates.TemplateManager.RegisterTemplateOverrides({
    // ..
});

On calendar NewForm.aspx get:

Uncaught ReferenceError: SPClientTemplates is not defined

Tried to wrap with this code, looks like it does not apply(no results, no errors):

ExecuteOrDelayUntilScriptLoaded(function () {

var defaultSubtypeLookupFieldTemplate = SPClientTemplates._defaultTemplates.Fields.default.all.all.Lookup.NewForm;

SPClientTemplates.TemplateManager.RegisterTemplateOverrides({
    // ..
});
}, 'ClientTemplates.js');

1 Answer 1

1

The JSLink property is not supported on Survey or Events lists. A SharePoint calendar is an Events list.

So there is no OOTB way to attach CSR js code with calendar list. For a workaround, you can create your own jQuery or vanilla javascript code and add it on the page by adding the reference in Content Editor Webpart/Script Editor webpart on that page.

Reference - Customize a list view in SharePoint Add-ins using client-side rendering

You can also checkout SPUtility.js or SPServices. They are quite decent and well documented.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.