I have an empty menu declaration and I add items to the menu client-side in response to various JavaScript events. I would like the menu items to expand up. I tried setting the DefaultGroupSettings ExpandDirection but the menu items still expand down. I have also tried setting the expand direction on the dynamically-added root menu items client-side, but I don't know if my syntax is right and this doesn't appear to work:
<
telerik:RadMenu
ID
=
"rmTaskMenu"
runat
=
"server"
EnableRoundedCorners
=
"true"
EnableShadows
=
"true"
style
=
"position:absolute;"
OnClientItemClicked
=
"TaskMenuClickedHandler_D"
>
<
DefaultGroupSettings
ExpandDirection
=
"Up"
/>
</
telerik:RadMenu
>
function
CreateItem_D(text, value) {
var
menuItem =
new
Telerik.Web.UI.RadMenuItem();
menuItem.set_text(text);
menuItem.set_value(value);
return
menuItem;
}
function
AddRootMenuItem_D(menu, category) {
var
categoryMenuItem = CreateItem_D(category,
'Category_'
+ category);
categoryMenuItem.get_attributes().setAttribute(
"category"
, category);
categoryMenuItem.get_groupSettings().set_expandDirection(
'Up'
);
// is this the correct syntax? If so, it isn't working
menu.get_items().add(categoryMenuItem);
return
categoryMenuItem;
}