I have a button which is placed on Kendo Panelbar. I was writing a jQuery function so that when user clicks on the button panelbar does not collapse. Other logic that I put on is that there is no post-back when 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();
}
});
Return
false
form your button click event handler function.Changed fiddle from chiapas answer
I managed to find a solution for your problem by creating a boolean variable that represents the possibility to expand or collapse the panelBar. When you click the button, it will "lock" the panel.
Then, on expand or collapse events, it will check this variable's value and
preventDefault
or not depending on it.Here's a fiddle