Refreshing subpanel from record.js shows no data on collapsed subpanel as well

Hi,
   I am working on customization, in which i have to refresh the subpanel on record view.

I am doing this to refresh the subpanel on record update.

initialize: function (options) {
this.model.on('data:sync:complete', this.refreshHistorySubpanel, this);
},
refreshHistorySubpanel: function (action, context) {
if (action === 'update') {
var subpanelCollection = this.model.getRelatedCollection('link');
subpanelCollection.fetch({
relate: true, view: 'subpane-view',
});
}
},

It shows me subpanel like this if there comes no data in subpanel even it is collapsed.

And then when i open it it looks like this


How can i make it not show no data available when subpanel is collapsed.

Thanks

  • Yep, we faced the same issue, and the reason is, the list-bottom view, which shows the "No data available" isn't properly hidden when you trigger the fetch programmatically.

    You can of course try to fix this using JS/backbone/event stuff, but there is one really easy fix through CSS. Just add these lines to your custom/themes/custom.less:

    .subpanel.closed.empty .block-footer {
    display: none;
    }

    The trick here is to not show the .block-footer (which shows the No Data Available) when the subpanel is .closed and .empty.

  • Hi Neeraja,

    Thank you so much it worked.


    Just to update i used this code

    
    

    .subpanel.closed.empty .block-footer{
      display: none;
    }
    .subpanel.closed .more.padded{
        display: none;
    }
    

    One for hiding no data available one and other for hiding the more results 

    Cheers!