다음을 통해 공유


Code Sample: Mouse Interaction

Applies to: SharePoint Server 2010

Note

The information in this topic applies to SharePoint 2013 as well as to SharePoint 2010. The samples provided in the SharePoint 2010 SDK also work in SharePoint 2013, but are not included in the SharePoint 2013 SDK.

The Mouse Interaction sample is one of three sample JavaScript files in the SharePoint 2010 SDK download file (SharePoint 2010 Reference: Software Development Kit) that show best practices for programming the Visio Web Access Web Part. The Mouse Interaction sample shows how to declare event handlers for the various Visio Web Access mouse-related events, and how to handle these events when they occur. It displays notifications in a Content Editor Web Part of mouse actions the user performs in the Visio Web drawing, such as entering a shape, leaving a shape, or changing the selected shape.

The JavaScript samples included in this SharePoint 2010 SDK are as follows:

  • Annotations sample

  • Custom Error Messages sample

  • Mouse Interaction sample

You can use these JavaScript files on your own Web Parts pages. The SharePoint 2010 SDK provides a brief document for each sample that explains how to use it, this topic being one of them, and the code in each sample file includes extensive explanatory comments.

Downloading the SharePoint 2010 SDK and Samples

  1. Download the SharePoint 2010 Reference: Software Development Kit, which includes the Custom Error Messages sample.

  2. When you install the SDK, the compressed (.zip) file that contains the samples is installed by default in the path C:\Program Files (x86)\Microsoft SDKs\SharePoint 2010\Samples\Visio Services. You can extract the samples to a folder location that you select.

Installing the Mouse Interaction Sample

Before you can install the sample, you must follow the instructions in the introduction of this article to download the SharePoint 2010 SDK and extract the sample. Then, complete each of the following procedures, which are explained in more detail in the topic Customizing Visio Web Drawings in the Visio Web Access Web Part in this SharePoint 2010 SDK:

  1. Create or open an existing Visio drawing that contains several shapes and save it as a .vdw file to a document library.

  2. Create a Web Parts page in Microsoft SharePoint Server 2010 and add a Visio Web Access Web Part to the page.

  3. Add a Content Editor Web Part to the same page.

  4. Link the Content Editor Web Part to the MouseInteraction.js file.

Also, you should follow the additional instructions in the comments in the sample file.

See Also

Concepts

Code Sample: Annotations

Code Sample: Custom Error Messages

Customizing Visio Web Drawings in the Visio Web Access Web Part