Skip to content

Instantly share code, notes, and snippets.

@ielcoro
Last active August 29, 2015 14:08
Show Gist options
  • Save ielcoro/e2a72a486d7d4834c8d0 to your computer and use it in GitHub Desktop.
Save ielcoro/e2a72a486d7d4834c8d0 to your computer and use it in GitHub Desktop.
Sharepoint Menu
var menu = CMenu("miNuevoMenu");
//Añadir opción
// CAMOpt(menu, opt.DisplayText, opt.OnClickAction, opt.ImageUrl, opt.ImageAltText, String(100 * idx), opt.Description);
var irAExpedientes = "STSNavigate2(event,'/SitePages/Expedientes.aspx')";
var imagen = "/_layouts/15/images/MiIcono.png";
var indice = 100;
var opcion1 = CAMOpt(menu, "Opción 1", irAExpedientes , imagen, "Texto Alternativo", indice, "Yo soy la opción1");
//Opcional: controlar el id
opcion1.id = 'Opciones' + indice;
//Opcional: Añadir Separador
//CAMSep(menu);
//Añadir Opción 2
indice = 200;
var opcion2 = CAMOpt(menu, "Opción 2", null , null, "Texto Alternativo", indice, "Yo soy la opción2");
//Opcional: controlar el id
opcion2.id = 'Opciones' + indice;
//Opcional: Ocultar iconos
//menu.setAttribute("hideicons", "true");
//Abrir Menu
//OMenu(menu, opt.Parent, null, false, opt.YOffset, opt.ShowMenuClose, opt.ShowMenuCheckboxes);
OMenu(menu, document.getElementById('Padre'),null, false, -2, false, false );
@ielcoro
Copy link
Author

ielcoro commented Oct 27, 2014

Esto genera elementos

en el marcado.En teoría se puede no utilizar las opciones de creación de menú y apuntar directamente a un elemento creado en el marcado

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment