I have some collapsible widgets that I am "routing open" by way of a view().param switch on the view's "afterShow" event.
Basically, if a user clicks a nav link I am taking them to a different collapsible in that view. This all works well, however I may have a bug or some odd behavior on my hands.
If in my onAfterShow function I call:
$(
"#giving-collapse"
).data(
"kendoMobileCollapsible"
).expand();
...But I am left with a zero height .km-collapsible-content block:
<div data-role="collapsible-content" class="km-collapsible-content km-animated" style="height: 0px; display: block;"><div>
So I have called this after calling .expand() ...
$(
"#giving-collapse .km-collapsible-content"
).css(
"height"
,
"auto"
);
Which works and shows the proper content.
Am I missing something or should this work straight away without a defined height change?
9 Answers, 1 is accepted
I tried to reproduce the scenario in a sample page but to no avail.
Could you please check my example and let me know what I am missing?
Looking forward to your reply.
Regards,
Alexander Valchev
Telerik
By default the widget is collapsed.
Please try to call the expand method after the content is loaded.
Regards,
Alexander Valchev
Telerik
You may use kendoWidgetCreated event.
Regards,
Alexander Valchev
Telerik
My previous reply (from 20-Apr-2015) was intended for other support thread. Please accept my apology for the mistake.
You may try to call the resize method of the Collapsible widget to force re-calculation of the content height. Method should be called after widget is opened and the content is changed.
Regards,
Alexander Valchev
Telerik
Thanks for the clarification.
Just an FYI... There isn't a reference to this method in the collapsible widget documentation "methods" list... But that seems to do the trick!
Thank you for the feedback, I documented the method. The changes should be published live soon.
Regards,
Alexander Valchev
Telerik