Hi,
I was wondering what is considered the "best" way to determine if a PanelBarItem is expanded or not? So far what I've been able to come up with is to check the "aria-expanded" property or see if the child <ul> is visible, both of which feel a bit dirty. Is there a better way, or is one of these two methods considered "better" than the other?
For context, I'm retrieving the item to check by using jquery.closest from one of the child items. Example:
Thanks,
Jeff
I was wondering what is considered the "best" way to determine if a PanelBarItem is expanded or not? So far what I've been able to come up with is to check the "aria-expanded" property or see if the child <ul> is visible, both of which feel a bit dirty. Is there a better way, or is one of these two methods considered "better" than the other?
For context, I'm retrieving the item to check by using jquery.closest from one of the child items. Example:
function
(id) {
var
child = $(
"#s-list-objectChild-"
+ id);
var
parent = child.closest(
"[id^='s-list-object-']"
);
if
(parent.isExpanded())
// Perform check here
doSomething();
else
doSomethingElse();
}
Jeff