This documentation is archived and is not being maintained.

SP.WebParts.WebPartDefinition object (sp.js)

SharePoint 2013

Represents a Web Part on a Web Part Page.

Last modified: March 09, 2015

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

var object = new SP.WebParts.WebPartDefinition()

Provides operations for moving, deleting, and changing the state of the Web Part.

The WebPartDefinition object has the following members.

Constructor

The WebPartDefinition object has the following constructor.

Constructor

Description

WebPartDefinition

Initializes a new instance of the SP.WebParts.WebPartDefinition object (sp.js) object.

Methods

The WebPartDefinition object has the following methods.

Method

Description

closeWebPart

Closes the Web Part.

deleteWebPart

Deletes the Web Part from the page.

initPropertiesFromJson

This member is reserved for internal use and is not intended to be used directly from your code.

moveWebPartTo

Moves the Web Part to a different location on a Web Part Page.

openWebPart

Opens the Web Part.

saveWebPartChanges

Saves changes to the Web Part made using other properties and methods on the SP.WebParts.WebPartDefinition object (sp.js).

Properties

The WebPartDefinition object has the following properties.

Property

Description

id

Gets a value that specifies the Web Part identifier of the Web Part.

webPart

The SP.WebParts.WebPart object (sp.js) represents a Web Part on a Web Part page associated with this SP.WebParts.WebPartDefinition object (sp.js).

Show: