Jayant Sharma

SharePoint Application Development

  Home  |   Contact  |   Syndication    |   Login
  39 Posts | 0 Stories | 24 Comments | 0 Trackbacks

News

Archives

Post Categories

Sunday, November 23, 2014 #

What is ECB Menu?

ECB stands for Edit Control Block, These are the context menu of SharePoint List and Library used to edit or customize lists and library.

image

Adding Hierarchal ECM Menu

function Custom_AddListMenuItems(m, ctx) {
    var menuItem = CASubM(m,"Menu Item", "/_layouts/images/alert.GIF")
   

    CAMOpt(menuItem, "Sub Menu Item 1", "alert('Hello World!');");
    CAMOpt(menuItem, "Sub Menu Item 2", "alert('Hello World!');");
   

    var subMenuItem = CASubM(menuItem,"Sub Menu Item 3")
    CAMOpt(subMenuItem, "Sub Menu Item 4", "alert('Hello World!');");
    CAMOpt(subMenuItem, "Sub Menu Item 5", "alert('Hello World!');");
    CAMSep(m); // separator
   

    return true; // render the default menu items too
}

Note: If Custom_AddListMenuItems function returns true, means do not render default menu.

Earlier Post:

http://geekswithblogs.net/JayantSharma/archive/2014/11/23/how-to-customize-sharepoint-ecb-menu-using-javascript--camopt.aspx

REF:

http://weblogs.asp.net/jan/customizing-the-sharepoint-ecb-with-javascript-part-1

http://weblogs.asp.net/jan/customizing-the-sharepoint-ecb-with-javascript-part-2

Thanks- Jayant Sharma