Thursday, March 25, 2010

Hide "Check In/Check Out" option from Context Menu using Content Editor WebPart (CEWP)

We often want to hide some options like Check In and Check Out from context menu. We can do this using a CEWP in the particular view.
Click on Site Actions > Edit Page
Click on Add a Web Part and select "Content Editor Web Part" from the options.
A CEWP will get inserted, click on the "edit" and select "Modify Shared Web Part".
On the right you will see a "Source Editor" button, clicking which will open a text editor where you can write javascript code to be used in that particular view.
Copy and Paste the following Code to hide the options from context menu.
*******************************************************************************



*******************************************************************************
AddCheckinCheckoutMenuItem is a function used in the Core.js file, we are overridding the same function and doing no actions inside the same. Like the same way, we can hide any option from the context menu.