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.
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.
This code may help you:
({
extendsFrom: 'BaseSubpanelLayout',
initialize: function(options) {
this._super('initialize', [options]);
},
_render: function() {
this._components[0].render();
this.$('.subpanel').toggleClass('closed', false);
}
})
I see how that code works but I cant see any way to narrow it down to a particular module.
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);
}
}
}
},
})
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);
}
}
}
},
})