javascriptkendo-ui

KendoPanelBar PreventDefault


I'm having problems understanding how preventDefault function works. I created a simple jsfiddle, but still, selections and expansion works and not prevented.

http://jsfiddle.net/XRfKb/15/

Any help is appreciated, thanks.

EDIT: How to prevent selection if page is not valid? Here's a piece of code:

panelBar.bind("select", function (e) {
   //some code here
   if (!isValid) {
            e.preventDefault(e); //doesn't work
            //this.select('#firstStep'); //doesn't work
        }
    });

Solution

  • I ended up by using simple "click" events for links in the PanelBar instead of "select" events for PanelBar.

    e.preventDefault and e.stopPropagation work fine for them.