5

Is there any way to customise the display form of a list using the Client Site Templates e.g.

// Register the template overrides.
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);

I know you can override each fields render handler doing something like this

 overrideCtx.Templates.Fields = {
        'Title': {
            'DisplayForm': customDisplayField //override display form
        }
    }   

    // Register the template overrides.
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);

But this doesn't allow me to change the layout of the form or remove the labels associated with each field

1

2 Answers 2

3

Technically, you can use JSLink to customize forms, but I never choose that approach. It depends on your skillset and the resources available to you. Usually, when we want to customize a form we do a custom JavaScript form from scratch. It just ends up being easier that way because even starting with simple changes we usually end up doing more later and more complicated customizations once users get their hands on things. So custom ends up being better in the long run.

One same using JSLink is listed above. Here is another: https://code.msdn.microsoft.com/office/CSR-code-samples-11-Fully-54ebcaa6

I've also been meaning to check out Stratus Forms. I haven't yet, but they're from Mark Rackley and he really knows his stuff. I recommend checking them out as a forms customization approach. http://www.stratusforms.com/

0

I'm not sure if this is still a problem for you, but I've solved this problem by using the OnPostRender functionality of JSLink.

The link below shows how to use the event to hide forms. (I wouldn't use this if data security is a big deal, only if the layout needs to be changed, or labels changed, etc.)

https://code.msdn.microsoft.com/office/Client-side-rendering-code-a52cf8a7

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.