Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "webparts/wp.d"

Index

Variables

Const WPCfg

WPCfg: (cfg: IWebPartCfg, props: IWebPartProps) => { renderForm?: (formControls: Array<IFormControl>) => void }

WebPart Configuration

Type declaration

    • Parameters

      Returns { renderForm?: (formControls: Array<IFormControl>) => void }

      • Optional renderForm?: (formControls: Array<IFormControl>) => void

        Method to render the edit form.

          • (formControls: Array<IFormControl>): void
          • Parameters

            • formControls: Array<IFormControl>

            Returns void

Const WebPart

WebPart: (props: IWebPartProps) => IWebPart

The client-side webpart component can be used to control what is displayed when a page is being edited and displayed. An optional hidden configuration element can be utilized to store a custom configuration.

import { WebParts } from "gd-sprest-bs";

// Create the webpart
WebParts.WebPart({
    elementId: "my-wp",
    cfgElementId: "my-wp-cfg",
    onRenderDisplay: (wpInfo) => {
        // Render the display element
        wpInfo.el.innerHTML = '<h1>Hello Display Mode</h1>';
    },
    onRenderEdit: (wpInfo) => {
        // Render the edit element
        wpInfo.el.innerHTML = '<h1>Hello Edit Mode</h1>';
    }
});

Type declaration

Generated using TypeDoc