Menu Dropdown List Click Event

Last post 12-07-2009, 9:21 AM by pthomas. 7 replies.
Sort Posts: Previous Next
  •  12-03-2009, 9:04 AM 57568

    Menu Dropdown List Click Event

    Hey, I added a custom Save As button is the menu bar that when clicked it displays a dropdown list with options of saving the doc in other formats.
     
    I added the Save AS button using the common.config file and it displays perfectly! :)
     
    My question is, how to I tie a click event function to the options in the Save As dropdown menu???
     
    Please responde!
    Thanks in advanced...
  •  12-03-2009, 10:21 AM 57569 in reply to 57568

    Re: Menu Dropdown List Click Event

    Please check this example:
     
    dynamically populate the dropdown menu

    How to dynamically populate the dropdown menu?( C# | VB )

    This example demonstrates how to programmatically populate the Cute Editor dropdown menu.

     
     
    The source code of this example can be found in the download package.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-03-2009, 10:57 AM 57574 in reply to 57569

    Re: Menu Dropdown List Click Event

    Im not trying to dynamically populate at runtime.
     
    I already have the New menu button added to the toolbar with the dropdown menu populated using the steps from http://cutesoft.net/developer+guide/index.html, under context menu customization.
     
    What I would like to know is from here, how do I add a click event to the custom items in the dropdown list?
    And thanks for the timely response.
  •  12-03-2009, 12:39 PM 57581 in reply to 57574

    Re: Menu Dropdown List Click Event

    Dear pthomas,
     
    You can refer to: http://cutesoft.net/example/customization.aspx , this example show you how to add customization button. In installation package, you can find the source of this example. Dropdown list is same as button customization.
     
     
    Regards,
    Eric
  •  12-03-2009, 2:46 PM 57587 in reply to 57581

    Re: Menu Dropdown List Click Event

    Can you supply some code showing how you would do this?
    In the example you stated, creates the button object in the code behind, then ties an event to it.
     
    Im wanting to know how to tie the event to a dropdown option that was NOT created in the codebehind....
    Is there a way that I can reach an object in the dropdown menu from the codebehind then tie an event to it?
     
    Thanks a bunch!
  •  12-04-2009, 8:35 AM 57600 in reply to 57587

    Re: Menu Dropdown List Click Event

    Hey you responded to my post yesterday about adding an event to a Dropdown menu.
     
    This is my example:
    This loads as a default with all the other buttons created in the common.config file.
     
    What I would like to know is how to add a click event to the "Save As Word" option for example?
    In the common.config file I have a name, command and text attribute that are labeled "Save As Word" and etc.
    I followed the steps similar to how the table dropdown was created in the toolbar.
    If  you can, can  you please show me some code?
     
    Please help me!
  •  12-07-2009, 8:44 AM 57647 in reply to 57569

    Re: Menu Dropdown List Click Event

    Hello???
    Someone help me please!!!
  •  12-07-2009, 9:21 AM 57649 in reply to 57647

    Re: Menu Dropdown List Click Event

    I figured it out, Example below.
     
    Add this javascript to the page...

    function CuteEditor_OnCommand(editor, command, ui, value) {

    if (command == "SaveAsPdf") { // This is the command of the Save as Pdf object I created in the common.config file

    // Then save as a pdf documnet

    return true;

    }

    }

View as RSS news feed in XML