Shalvin Interests

Saturday, August 18, 2012

Replacing existing button with new Button in SharePoint 2010 with Custom Action

<CustomAction Id="Ribbon.Documents.New.NewFolder.ReplaceButton"
     Location="CommandUI.Ribbon"
     RegistrationId="101"
     RegistrationType="List"
     Title="Replace Ribbon Button">
    
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.Documents.New.NewFolder">
          <Button Id="Ribbon.Documents.New.NewFolder.ReplacementButton"
            Command="MyNewButtonCommand"
            Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png?vk=4536" Image16by16Top="-240" Image16by16Left="-80"
            Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png?vk=4536" Image32by32Top="-352" Image32by32Left="-448"
            ToolTipTitle="Create a New Folder"
            ToolTipDescription="Replaced by XML Custom Action"
            LabelText="Shalvin New Folder"
            TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="MyNewButtonCommand"
          CommandAction="javascript:alert('New Folder Replaced by Shalvin');" />
      </CommandUIHandlers>
    </CommandUIExtension>
    
  </CustomAction>

No comments:

Post a Comment