Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3788
How can i diasble serverside webexplorerbar event to fire using javascript ClientSide itemClick event?
posted

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?

Parents
No Data
Reply
  • 3726
    Suggested Answer
    posted

    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

Children