3 Answers, 1 is accepted

You have not specified any RadControl in particular, So let me explain with regard to RadMenu.
The OnClientItemClicking client-side event occurs when the user clicks on a menu item, before the menu responds to the mouse click.
The event handler receives two parameters:
-
The instance of the menu firing the event.
-
An eventArgs parameter containing the following methods:
-
get_item returns a reference to the RadMenuItem that was clicked.
-
set_cancel lets you prevent the menu from responding to the mouse click.
-
get_cancel returns a boolean value indicating whether the mouse click was cancelled.
-
get_targetElement (RadContextMenu only) returns a reference to the target element attached to the context menu that is responsible for the context menu showing.
-
get_domEvent returns a reference to the DOM event that caused the clicking.
You can use this event to pre-process an item click or to cancel the default response.
JavaScript:
<script type=
"text/javascript"
>
function
onClicking(sender, eventArgs) {
var
item = eventArgs.get_item();
var
navigateUrl = item.get_navigateUrl();
if
(navigateUrl && navigateUrl !=
"#"
) {
var
proceed = confirm(
"Navigate to "
+ navigateUrl +
" ?"
);
if
(!proceed) {
eventArgs.set_cancel(
true
);
}
else
{
eventArgs.set_cancel(
false
);
}
}
}
</script>
-
The OnClientItemClicked client-side event occurs when the user clicks on a menu item, after the menu responds to the mouse click.
The event handler receives two parameters:
-
The instance of the menu firing the event.
-
An eventArgs parameter containing the following methods:
-
get_item returns a reference to the RadMenuItem that was clicked.
-
get_targetElement (RadContextMenu only) returns a reference to the target element attached to the context menu that is responsible for the context menu showing.
-
get_domEvent returns a reference to the DOM event that caused the clicking.
You can use this event to respond when the user clicks on a menu item:
JavaScript:
<script type=
"text/javascript"
>
var
clipboardEmpty =
true
;
function
copyPasterItemClicked(sender, args) {
var
clipboardElement = $get(
"hdClipboard"
);
var
itemValue = args.get_item().get_value();
if
(itemValue ==
"Cut"
) {
clipboardElement.value = args.get_targetElement().value;
args.get_targetElement().value =
""
;
clipboardEmpty =
false
;
}
if
(itemValue ==
"Copy"
) {
clipboardElement.value = args.get_targetElement().value;
clipboardEmpty =
false
;
}
else
if
(itemValue ==
"Paste"
) {
args.get_targetElement().value = clipboardElement.value;
}
}
</script>
Thanks,
Princy.
-

So what are the situations when I OnClientItemClicked has 'advantages' before OnClientItemClicking
? seems that OnClientItemClicking has all the options that OnClientItemClicked has and some additional!

Its not like OnClientItemClicking has all the options that OnClientItemClicked has and some additional. Let me explain with an example. Suppose you are clicking a RadMenuItem and you are checking some conditions from client-side before navigating. If few conditions are not satisfied you want to cancel the click event. In such a scenario, you may use OnClientItemClicking. All those things you want to execute before a control responds to the mouse click event is written inside the OnClientItemClicking whereas things you want to execute after control responds to the mouse click is written in OnClientItemClicked.
Thanks,
Princy.