0

When I click on a bar of a PanelBar I both select the option as well I toggle it (open / close). Is it possible not to open it but just select and click on the icon for controlling open/close?

OnaBai
  • 40,767
  • 6
  • 96
  • 125

2 Answers2

2

I am afraid this is not supported. As a partial work-around you can make the PanelBar expand and select only by clicking the expand arrow like this:

$('#panelbarName>li').on('click',function(e){
   if(!$(e.target).is('.k-icon')){
      e.stopPropagation(); 
   }       
})

Unfortunately there is much more logic to be handled to just select (highlight the item) without expanding it.

Petur Subev
  • 19,983
  • 3
  • 52
  • 68
  • I have accepted your proposal as answer event that is not complete (as you already pointed out) but I get the idea and actually I was looking if there was some (hidden) option for getting it. Not existing it, I will reconsider the UI for not looking for complex solutions. – OnaBai Nov 27 '12 at 22:11
1
$("#panelbar>li").on("click", function (e) {
    if ($(e.target).is(".k-i-arrow-s")) {
        $("#panelbar").data("kendoPanelBar").expand($(e.target).closest("li"));
    }
    else if ($(e.target).is(".k-i-arrow-n")) {
        $("#panelbar").data("kendoPanelBar").collapse($(e.target).closest("li"));
    }
    else {
        $("#panelbar").data("kendoPanelBar").select($(e.target).closest("li"));
    }
    e.stopPropagation();
})
Ajai Johal
  • 89
  • 4