Created an Element in the ECB menu with dynamic items, when you try to access an item by clicking, the entire array is traversed and the last item is substituted, help the clicker to display the value of the desired item?
F12:
Code:
var L_DocumentLibrary_Text = "Copy items";
strDisplayText = L_DocumentLibrary_Text;
var docLib = CASubM(m,strDisplayText,"","",400);
docLib.id = "id_L_DocumentLibrary_Text";
var Const_DocLibs_Array = ["item 1", "item 2", "item 3", "item 4"];
for(var i = 0; i < Const_DocLibs_Array.length; i++)
{
var L_Doc_Text = Const_DocLibs_Array[i];
strDisplayText = L_Doc_Text;
strAction = "console.log('" + strDisplayText + "');";
strImagePath = ctx.imagesPath + "existingLocations.gif";
menuOption = CAMOpt(docLib,strDisplayText,strAction,strImagePath);
menuOption.id = "id_" + L_Doc_Text;
}