This is a migrated thread and some comments may be shown as answers.

Context menu with page method

1 Answer 82 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Janni
Top achievements
Rank 1
Janni asked on 04 Sep 2008, 12:44 PM
Hi,

I'm using the context menu in a Microsoft Grid. I want to hide different menu items depending on the current selected row. I have used a page method and a callback to determine which menu items to hide. The problem is that the menu (the first time after the page was loaded) is displayed with double line spacing. Next time the context menu is displayed, it appears with correct line spacing.

My sample code is as follows:

<telerik:RadContextMenu runat="server" ID="ctxMenu" OnClientShowing="showingContextMenu" >

function showingContextMenu(menu, args)
{
 var target = args.get_targetElement();
 if (target)
 {
  if (target.value == '')
   args.set_cancel(true);
  else 
   PageMethods.GetMenuItemsToHide(currentID, showMenuCallback);
 }
}

function showMenuCallback(result)
{
 var contextMenu = $find('FilterCtrl_ctxMenu');
 for(var i=0; i < result.length; ++i)
 {
  contextMenu.findItemByValue(result[i]).hide();
 }
 $telerik.cancelRawEvent(event);
}

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 08 Sep 2008, 02:53 PM
Hello Janni,

Which skin do you use?

Can you send us a sample project in a new support ticket demonstrating the problem?


Sincerely yours,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Menu
Asked by
Janni
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or