2 minute read

The list form class is designed to help with rendering custom list forms, including saving and getting advanced details for complex field types. Reference the list form field class for additional information, related to getting complex field information (lookup, mms, etc). These classes are referenced by the react and bootstrap list components.

Constructor

Property Type Required Default Value Description
cacheKey string No ”” The key to store the list information in session storage.
fields Array<string> No [] An array of internal field names. If null, the default form fields are returned.
item IListItemQueryResult | IListItemResult No null The target list item reference.
itemId number No 0 The item id to get as part of the request.
listName string Yes ”” The list name.
loadAttachments boolean No false Flag to include the list item attachments as part of the request.
query ODataQuery No {} The odata query used when querying for the item.
webUrl string No ”” The relative url containing the list. If blank, the current web is used.

Methods

Name Return Type Description
loadAttachments(listInfo: IListFormProps) PromiseLike<Array<Types.SP.IAttachment>> Loads the item attachments.
refreshItem(listInfo: IListFormResult) PromiseLike<IListFormResult> Refreshes the list item.
removeAttachments(listInfo: IListFormProps, attachmentInfo: _Array<Types.SP.IAttachment>) PromiseLike<void> Removes the attachments.
saveAttachments(listInfo: IListFormProps, attachmentInfo: Array<IListFormAttachmentInfo>) PromiseLike<Array<Types.SP.IAttachment>> Saves the attachments.
saveItem(info: IListFormResult, formValues: any) PromiseLike<IListFormResult> Saves the list item.

IListFormAttachmentInfo

Property Type Description
data any The file content.
name string The name of the file.

IListFormResult

Property Type Description
attachments Array<IAttachment> The list item attachments.
fields { [key: string]: IFieldResult } The list fields.
item IListItemQueryResult | IListItemResult The list item.
query ODataQuery The odata query used when querying for the item.
list _IListResult The list.