How do I force a subpanel to be open

I am looking to force a particular subpanel, say Documents, to be open on the loading of a record.  I have found a little code but its all 6.x related.

Parents Reply
  • Hello Kenneth,

    here is my take on this one. I know it's some time ago but maybe could be useful to someone else!

    Note: This code should not obey the application level collapse settings (in Admin->System Settings).

    custom/clients/base/layouts/panel/panel.js

    Line 7 Subpanel module

    Line 9 Main Record module

    ({
        extendsFrom: 'PanelLayout',

        _initPanelState: function() {
          this._super('_initPanelState');

          if(this.module=='Contacts') {
            if(!_.isUndefined(this.context.attributes.parentModule)) {
              if(this.context.attributes.parentModule == 'Cases') {
                this.context.set('collapsed', true);
              }
            }
          }
        },

    })
Children
No Data