Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent Kendo PanelBar from collapsing when I click button which is placed on the PanelBar itself

I have a button which is placed on a Kendo PanelBar. I was writing a jQuery function so that when user clicks on the button, the PanelBar does not collapse. I put some other logic in so that there is no post-back when the button is clicked. I can't get this to work. Help appreciated! :) Here is the code snippet.

$("#panelBarCarDetails").kendoPanelBar({
        expandMode: "multiple"

        $('#btnTakeOwnership').click(function (e) {
            if (e.target) {
                e.preventDefault();

            }             
          });
like image 701
HereToLearn_ Avatar asked Oct 18 '25 21:10

HereToLearn_


1 Answers

Return false form your button click event handler function.

$('#btnTakeOwnership').click(function (e) {
        if (e.target) {
            e.preventDefault();
        }             
        return false;
      });

Changed fiddle from chiapas answer

like image 73
Lukasz S Avatar answered Oct 20 '25 12:10

Lukasz S