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

open and close radcontext menu on click of same button

1 Answer 45 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Toad
Top achievements
Rank 1
Toad asked on 10 Feb 2012, 07:58 AM
I have radcontextmenu which opens on click of a button, after opening it should stay open until same button is clicked again, but when I click that button again instead of closing it, the button reopens the context menu, please help.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Feb 2012, 10:19 AM
Hello,

Try the following javascript.
JS:
<script type="text/javascript">
   var i = 0;
  function showMenu(args)
  {
     var menu = $find("<%=RadContextMenu1.ClientID %>");
      if (i == 0)
       {
        menu.show(args);
        i = 1;
       }
      else
        {
        menu.hide();
        i=0;
       }
   }
</script>

Thanks,
Princy.
Tags
Menu
Asked by
Toad
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or