Menu.onUpdateItem = function (id, state) { switch (id) { case "id0": // disable the menu item state.enable = false; break; } }