Enabling ECB menu on a custom column in SharePoint 2010 (Part 1)


If you have ever tried to enable the ECB menu on a column other than Name or Title in MOSS 2007, you will love a new feature of SharePoint 2010, Show List Item Menu, like the screenshot below. This feature allows us to enable the ECB menu on almost all columns.

image

In SharePoint Designer, if we select this option and save our changes, the ECB menu will be enabled on this column.

image

It works very well on the columns in lists. However, there is a little problem when we use this feature on a column in the document library. For example, when I enable the ECB menu on Title of a document library, the ECB menu is displayed as below. ( I also put a screenshot for the ECB on Name column for the contrast. )

image

image

It shows “Edit in undefined” instead of “Edit in Microsoft Word” which is expected to be shown. And if I click on this menu item, I got the following error with no surprise, although Microsoft Word has been installed on this machine. 

image

Why this problem happens is because in SharePoint 2010 the ECB menu is generated and rendered by a set of JavaScript calls dynamically. When in document library, those calls will try to determine the document type with the current column and add a menu item displayed as “Edit in Microsoft Word” or “Edit in Microsoft Excel” etc according to the type returned. For Name column whose field type is LinkFilename, the JavaScript calls can retrieve the file type because this column has a reference to the field FileLeafRef. But for Title column here, since it does not have the reference to FileLeafRef, the calls simply return an undefined.  For some reason, these JavaScript calls work fine with the Name column whose field type is LinkFilename. The document type can be retrieved. But for the Title column, the calls simply return an undefined. Looks like the code does not check whether the returned value is undefined or not, therefore we see “Edit in undefined” in the menu.

This might be a bug of the code. At least an error checking here is necessary. If the returned value is undefined, the ugly “Edit in undefined” should not be shown. But before there is an official fix, actually I have no idea whether it will be fixed or not, is there any way to enable an ECB menu with “Edit in Microsoft Word” on Title column? Well, I am going to answer this question in the part 2 of this topic.

Comments (7)

  1. Neil says:

    Did you ever find a fix for this?

    Many thanks..

  2. Zane D. says:

    when I tried this, it worked…but the values in the column don't turn blue or turn into a hyperlink until after I hover over them and click on the drop-down arrow to display the menu.  I simply click outside of the menu to close it, then all of a sudden the value is now blue and hyperlinked.  but only for the item that i clicked on, not all of them.

  3. Farhad says:

    can everyone explain step by step how to enable ecb menu?

    is this in allitems.aspx or some where else?

  4. Sarah says:

    Hi, I have enabled the ECB against a custom field but when I click on 'Version History' in the menu I get a dialoge box that says 'Error .. Item does not exist..'. Do you know why I might get that please? (the version history option still works if I use the menu against the original Title field)

  5. Slawa says:

    it wasn't explained which file must edit in SPD… this is a key point (

  6. Rachna says:

    Hi, I have enabled the ECB against a custom field but when I click on 'Version History' in the menu I get a dialoge box that says 'Error .. Item does not exist..'. Do you know why I might get that please? (the version history option still works if I use the menu against the original Title field)

Skip to main content