4

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();

            }             
          });
HereToLearn_
  • 1,150
  • 4
  • 26
  • 47
  • That inner code shouldn't be there, you are defining the panelBar in it, you can't place that function there, it must be outside – chiapa Aug 06 '15 at 15:01
  • do you think ready function would be a good place for it ? – HereToLearn_ Aug 06 '15 at 15:06
  • No, it may be independent. Place it [like this](http://jsfiddle.net/3hmfqfuv/) – chiapa Aug 06 '15 at 15:07
  • Thanks ! ya that makes sense for this function to be independent. – HereToLearn_ Aug 06 '15 at 15:12
  • Do you know @chiapa how do preventDefault of the Kendo PanelBar when button click ? I tried this code but it did not work. http://jsfiddle.net/vjjt2L0p/ – HereToLearn_ Aug 06 '15 at 15:23
  • That code can never work, give me a sec. The Kendo UI demos page is unavailable now. What have you got, a panelBar with a button in it? And if you click the button, the panelBar collapses? – chiapa Aug 06 '15 at 15:25
  • I have got a Kendo PanelBar. On it I have a button and I dont want the panelbar collapse/expand when user clicks on this button. User can click on panelbar anywhere but the button and panelbar will behave like expected. – HereToLearn_ Aug 06 '15 at 15:33
  • You mean you have something [like this](http://dojo.telerik.com/@joaosimoes/ERufI)? – chiapa Aug 06 '15 at 15:40
  • Not really. So in your example suppose lets say I want to put a button on Projects panelbar. So I would placed it somewhere like this:
  • Projects What would we have to do so that when someone clicks on button whats up the Projects panelbar would not expand or collapse. Does that make sense ?
  • – HereToLearn_ Aug 06 '15 at 15:49
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/85318/discussion-between-chiapa-and-heretolearn). – chiapa Aug 06 '15 at 15:56
  • Just saw this and I replied you in chat window! – HereToLearn_ Aug 07 '15 at 12:13