How can i diasble serverside webexplorerbar event to fire using javascript
ClientSide itemClick event?
i have a clientSide and server side ItemClick event in WebExplorerBar,
if i do click on any item then my client side side script execute and
ask for confirmation
like confirm("Do yo want to process"), if user cliked on cancel, then
server side event should not be execute.
So how can i prevent to execute server side event?
Hi,
ItemClick event can not be canceled. But you could stop the postback from happening in the following ways:
1) set the following to item event args: args._props[1] = 0; Setting 1 will make full postback, setting 2 will make async postback.
2) add a cancel function to the args:
function itemClick(sender, args) {
args.get_cancel = function() { return this._cancel; }
args.set_cancel = function(val) { this._cancel = val; }
if (someCondition) {
args.set_cancel(true) ;
}
Hope this helps.
Thanks,
Lubomir
The ItemClick event also fires the NodeClick action and the cancel argument is working for the item click while the nodeclick postbacks the form is there any way by which i can cancel the node click action as it is not shown in the clientevent list.