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

Changing items in collapsed panels

6 Answers 255 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Guru
Top achievements
Rank 2
Guru asked on 06 Jun 2012, 10:40 PM
Posting this to ask if it is a bug or expected... and also maybe help others with this issue.
If you have collapsed panels and try to enable/disable/jQuery.show/jQuery.hide/etc... to elements in the collapsed panel you get no effect or very undesired/buggy effects.

Here is my solution:
//get panelbar objects and collapsed/enabled status
 var panelBar = $("#PanelBar").data("kendoPanelBar");
 var editorBar = $('[id^="PanelEditor"]');
 var editorBarIsDisabled = editorBar.hasClass("k-state-default");
 
 //expand panelbars so we can show/hide controls
 if (editorBarIsDisabled) panelBar.expand(editorBar);
 
 // do visual changes here etc...
 
 //collapse panelbars if they were already
 if (editorBarIsDisabled) panelBar.collapse(editorBar);

6 Answers, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 07 Jun 2012, 07:06 AM
Hi Zack,

What are the undesired effects you're getting? Can you elaborate a bit?

For your code - you may consider using the expand/collapse() second option to disable the animations - something like expand("li:first", false).

Kind regards,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Guru
Top achievements
Rank 2
answered on 07 Jun 2012, 02:18 PM
The main problem was that I have panel bar with a couple levels of children panels, and in about 2 levels deep I have a panel that is a toolbar with some jquery ui buttons.
If i call jQuery.hide or try to disable them while the panel is collapsed, once the panel is expanded the button is still visible... but it was inconsistent... sometimes it would hide. If I call this workaround to expand them, then apply hide/disable, then collapse them, when the user expands they are hidden as desired 100% of the time.
0
Accepted
Kamen Bundev
Telerik team
answered on 07 Jun 2012, 03:12 PM
Hello Zack,

This is strange - when an item is collapsed - its content just has display: none set and shouldn't be affecting elements in it. You can try setting a class which has display: none instead of show/hide and see how that goes. However about disabling the buttons you should consult jQuery UI documentation if there are any requirements.

All the best,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Guru
Top achievements
Rank 2
answered on 07 Jun 2012, 07:48 PM
You are correct it is leaning towards a jq ui issue at this point, I do see that your collapsed state is simply display:none which you should be able to apply styling to elements within that. Thanks for your input.
0
Guru
Top achievements
Rank 2
answered on 07 Jun 2012, 09:40 PM
The workaround causes the panel to no longer be expandable... in internet explorer only of course... I hate how there are so many browsers to deal with. I am trying to track this down... This may be a panel bar issue itself but I think for now I may try to avoid the whole problem by not using jqui buttons...
0
Guru
Top achievements
Rank 2
answered on 07 Jun 2012, 10:05 PM
The final solution was to remove the animation duration from the jq hide/show effects. I had a wrapper on the calls that defaulted as 'fast' which actually makes the call a jquery animation. Removing the default duration allows the buttons to hide as expected.
Tags
PanelBar
Asked by
Guru
Top achievements
Rank 2
Answers by
Kamen Bundev
Telerik team
Guru
Top achievements
Rank 2
Share this question
or