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

Menu with AJAX onRequestStart

1 Answer 42 Views
Menu
This is a migrated thread and some comments may be shown as answers.
David Beck
Top achievements
Rank 1
David Beck asked on 16 Mar 2011, 06:11 PM
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>

1 Answer, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 18 Mar 2011, 05:04 PM
Hi David Beck,

You may use the:

args.EventArgument

It is unique for every menu item.

Regards,
Helen
the Telerik team
Tags
Menu
Asked by
David Beck
Top achievements
Rank 1
Answers by
Helen
Telerik team
Share this question
or