I am able to add custom context menus, determine which menu items have been selected and disable the ones I don't need. I need to take one step further and disable specific menu items depending upon the extension of the file selected.
I am coding everything in the OnGridContextShown function but one thing I have not been able to identify is the value of the selected item in the grid. if I can get this, I can determine whether to disable a menu item or not.
Any suggestions?
Thanks
function OnGridContextShown(sender, args) {
// How do I get the file name of the selected item?
var treeContextMenuItems = sender.get_allItems();
for (var i = 0; i < treeContextMenuItems.length; i++) {
var menuItem = treeContextMenuItems[i];
if (menuItem.get_value() == "Extract" || menuItem.get_value() == "Upload") {
if (menuItem.get_value() == "Upload") {
menuItem.disable(); // Disable the extract and upload function
}
}
}
}