This is a migrated thread and some comments may be shown as answers.

Expand/Collapse arrow fails to appear if a class matching a certain pattern appears anywhere in the header

1 Answer 141 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Andrew asked on 15 Nov 2018, 01:13 AM

This is an error that took us an hour to figure out.

We are using the right-arrow icon as part of the content within a collapsible header to represent a transition. (See image)

We found that the expand/collapse icon did not appear.


Further investigation reveals that if the header content contains a span with a class matching the regular expression k-i-arrow.* then the expand/collapse icon doesn't work.

See this example.




1 Answer, 1 is accepted

Sort by
Telerik team
answered on 16 Nov 2018, 12:18 PM
Hello Andrew,

In general, the current implementation of the PanelBar does not provide a way to customize the header. The recommended way to approach this would be to implement a headerTemplate option for the widget. Thus, I would strongly encourage you to log this as a new feature request in the Kendo UI Feedback Portal. Based on the demand and gathered feedback from the rest of the community, this feature could be implemented in a future release of the suite.

You are also indeed correct that with the current state, adding an inline icon breaks the expand/collapse icon. As a workaround I would suggest the following approach:

1) When adding custom icons to an item include the expand icon:
    This header has the arrow right icon.
    <span class="k-icon k-i-arrow-right"></span>
    <span class="k-icon k-panelbar-expand k-i-arrow-60-down"></span
  <div>You will find the arrow is not there, or disappeared</div>

2) Subscribe to the expand and collapse events of the PanelBar and toggle the icon class:
  expand: function(e) {
  collapse: function(e) {
    $(e.item).find(".k-panelbar-expand").removeClass("k-i-arrow-60-down").addClass("k-i-arrow-60-down   ")

The above is also demonstrated on the following Dojo example.

Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question