Context Menu

Last post 05-17-2010, 2:13 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  05-14-2010, 5:53 PM 61030

    Context Menu

    Hi,
     
    We are marking up the HTML with custom tags. We've set these so they can not be editable so the user doesn't do anything unexpected. We use the ContentEditable="false" attribute in the tag which allows for that. We've configured the context menu to pop the properties window for modifying the tag. All is good.
     
    Our issue is being able to delete the tag in the case the user wants to remove it. You'd think you could click the tag and press delete but that can't be performed now that ContentEditable is false. What we'd like to do is put a Delete on the context menu that fires a simple removal of that tag.
     
    Is is possible to add to the context menu our custom Delete item but only show it when our tag is clicked and then be able to fire an API call to remove the tag? If so, could someone point us in the general direction to accomplish that?
     
    Our other option would be to place a remove button on the property popup, not preferred but I guess that would work.
     
    Thoughts?
     
     
    Thanks,
    -Charles
  •  05-17-2010, 2:13 AM 61044 in reply to 61030

    Re: Context Menu

    Hi CAP,
     
    Add a new delete option into context menu,it can be use even the tag ContentEditable  set to false.
     
    1. <%@ Page Language="C#" ValidateRequest="false" %>   
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>   
    4. <html>   
    5. <head>   
    6. </head>   
    7. <body>   
    8.     <form id="Form1" runat="server">   
    9.         <CE:Editor ID="Editor1" runat="server">   
    10.         </CE:Editor>   
    11.     </form>   
    12. </body>   
    13. </html>   
    14.   
    15. <script>   
    16.    function CuteEditor_AddMainMenuItems(menuitem)   
    17. {   
    18.     menuitem.AddMenuItem(1,"Delete","delete.gif",DefaultMenuHandler);   
    19. }   
    20. function DefaultMenuHandler(menuitem)   
    21. {   
    22.   menuitem.editor.ExecCommand("Delete")   
    23. }   
    24.   
    25. </script>  

    Hide the default delete menu
     
    1. Open "CuteSoft_Client\CuteEditor\Configuration\ContextMenuMode\Default.config"
     
    2. Find section below and delete it
     
     <ref name="Delete" />
     
    Regards,
     
    ken
View as RSS news feed in XML