Is there a way to retrieve the collapsed state of a group from within a toolbar item listener function? I have only 1 group and this is what I came up with, but it is pretty janky. All the commented out lines are things that I've tried.
{
type:'button',
label: 'Toggle Sites',
listener: function() {
//var $siteGrpOpts = this.groupOption('collapsed');
var $site = this.Group();
window.siteCollapsed = !window.siteCollapsed;
if (window.siteCollapsed) {
$site.collapse();
} else {
$site.expand();
}
//var $siteState = this.option('groupModel.collapsed[0]');
//var $siteState1 = $site.option.collapsed;
//var $siteState2 = $site.groupOption('collapsed');
//this.groupOption('collapsed', !$siteState1);
}
},