When I set an item to expand on initial render (via .Expanded(true)) I lose formatting.
I suspect this is because the item loses class "k-state-default" and we have overridden css for this class. I have worked around by adding the class directly:
panelbar.Add()
.Text(
"Expanded Item"
)
.HtmlAttributes(
new
{@
class
=
"k-state-default"
})
.Expanded(
true
)
.Content(...
This seems to me to be a bug rather than default behaviour. Why would expanding on initial render be different from expanding via mouse click?
There is something in kendo.panelbar.js that looks a bit suspicious to me:
wrapperCssClass:
function
(group, item) {
var
result =
"k-item"
,
index = item.index;
if
(item.enabled ===
false
) {
result +=
" "
+ DISABLEDCLASS;
}
else
if
(item.expanded ===
true
) {
result +=
" "
+ ACTIVECLASS;
}
else
{
result +=
" k-state-default"
;
}
if
(index === 0) {
result +=
" k-first"
;
}
if
(index == group.length-1) {
result +=
" k-last"
;
}
if
(item.cssClass) {
result +=
" "
+ item.cssClass;
}
return
result;
},
Can someone confirm if this is a bug or just me being dim.
Also, is my workaround safe (i.e. it won't interfere with the operation of the control).
Cheers,
Mark