or
Basically what I'm trying to do here is expand and collapse two panels when one panel is expanded and collapsed.
The flyer panel bar expands just fine when the order panel bar is clicked.
However, the second time through, when the order panel bar is clicked and collapses, the flyer info panel bar does not also collapse.
I've looked through the javascript console, no errors are coming up and I've stuck an alert in the collapse portion which pops up, but still it does not collapse.
What else can I try to get these two panel bars in sync as far as when they expand and collapse?
$(
"#orderInfoPanelBar>li"
).on(
'click'
,
function
(e) {
var
flyerInfoPanelBar = $(
"#flyerInfoPanelBar"
).data(
"kendoPanelBar"
);
var
orderInfoPanelBar = $(
"#orderInfoPanelBar"
).data(
"kendoPanelBar"
);
/* Expand the flyer panel bar if it is not already expanded */
if
(flyerInfoPanelBar.element.children(
"li"
).hasClass(
"k-state-active"
) !=
true
) {
//var panelBar = $("#flyerInfoPanelBar").data("kendoPanelBar");
$(
"#flyerInfoPanelBar"
).data(
"kendoPanelBar"
).expand($(
"#li_flyerInfo1"
));
$(
"#flyerInfoPanelBar"
).data(
"kendoPanelBar"
).select($(
"#li_flyerInfo1"
));
}
/* Collapse the flyer panel bar if the order panel bar is being collapsed as well */
if
(orderInfoPanelBar.element.children(
"li"
).hasClass(
"k-state-active"
) ==
true
&&
flyerInfoPanelBar.element.children(
"li"
).hasClass(
"k-state-active"
) ==
true
) {
$(
"#flyerInfoPanelBar"
).data(
"kendoPanelBar"
).collapse($(
"#li_flyerInfo1"
));
}
});
<
div
id
=
'main'
>
<
ul
data-role
=
"panelbar"
data-expand-mode
=
"single"
>
<
li
xclass
=
"k-state-active"
>
Send Email
<
div
style
=
"padding: 10px;"
>
<
textarea
xdata-role
=
'editor'
data-bind
=
'value: emailBody'
>
</
textarea
>
</
div
>
</
li
>
<
li
>
Send Text
<
div
style
=
"padding: 10px;"
>
Text Stuff
</
div
>
</
li
>
<
li
>
Dymo label
<
div
style
=
"padding: 10px;"
>
Label Stuff
</
div
>
</
li
>
</
ul
>
</
div
>
<
script
>
console.log(kendo.version)
var viewModel = kendo.observable({
emailBody: '',
actionEmail: function(ev) {
}
})
kendo.bind($("#main"), viewModel);
</
script
>