3

I want to edit the item name (Edit Item) to custom name (any) in Edit control block (ECB) of list using JavaScript or jQuery in SharePoint.

Please click for image ECB

1 Answer 1

2

You could change Strings.STS.L_EditItem_Text, its where the ECB gets its value for "Edit Item". It could be used in different places, so probably best to change it only when the CallOut on the ECB is used.

A possible solution could look like this, I dont have much experience with the OOTB ECB tbh, so there could be some better options out there.

$(".ms-list-itemLink").each(function(e,i)  { 

    $(this).click(function() {

        CalloutManager.forEach(function(i) {
            var stsValue = Strings.STS.L_EditItem_Text;
            if(i.isOpening()) { 

                i.addEventCallback("closing", function() { 
                    Strings.STS.L_EditItem_Text = stsValue;
                });

                i.addEventCallback("opening", function() { 
                    Strings.STS.L_EditItem_Text = "Something else";
                });

            }
        });

        Strings.STS.L_EditItem_Text = "Something else";
        $(this).unbind("click");
    });
});  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.