Menu with AJAX onRequestStart

2 posts, 0 answers
  1. David Beck
    David Beck avatar
    38 posts
    Member since:
    Jun 2010

    Posted 16 Mar 2011 Link to this post

    Hello,

    I have a menu that when a user clicks an item it postback using the RadAjaxPanel.

    Well in certain items i need to cancel the ajax request for like the 'DOWNLOAD FILE' item but leave it on for other items.

    Im using the Panels onRequestStart but all it returns in the eventtarget is my menu ID is there anyway to find the ITEM within the menu that triggered the AJAX?

    Or should i make a custom menu items with buttons?

    CODE:
    <script type="text/javascript">
                function onRequestStart(sender, args) {
                    if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                        args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                        args.get_eventTarget().indexOf("ExportToCsvButton") >= 0 ||
                        args.get_eventTarget().indexOf("ExportToPdfButton") >= 0) {
                        args.set_enableAjax(false);
                    }
                    if (args.get_eventTarget().indexOf("FilesMenu") >= 0)
                    {
                        alert("ET: " + args.get_eventTarget());
                        alert("EA: " + args.get_eventArgument());
                        alert("ETE ID: " +args.get_eventTargetElement().id);
                        args.set_enableAjax(false);
                    }
                }
            </script>
  2. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 18 Mar 2011 Link to this post

    Hi David Beck,

    You may use the:

    args.EventArgument

    It is unique for every menu item.

    Regards,
    Helen
    the Telerik team
Back to Top