artem_niko Posted January 21, 2023 Share Posted January 21, 2023 Good afternoon! Is it possible to place an image on UniPageControl? I would like to display a picture if the UniPageControl does not contain, at the moment, tabs. But if it contains at least one tab, then do not show the picture. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 21, 2023 Share Posted January 21, 2023 7 hours ago, artem_niko said: I would like to display a picture if the UniPageControl does not contain, at the moment, tabs. But if it contains at least one tab, then do not show the picture. 1. function tabPanel.afterrender(sender, eOpts) { sender._refreshBody = function() { if (sender.tabBar.getRefItems().length == 0) { sender.ownerCt.addBodyCls('customBody') } else { sender.ownerCt.removeBodyCls('customBody') } }; sender._refreshBody(); sender.on('add', sender._refreshBody); sender.on('remove', sender._refreshBody); } 2. CustomCSS: .customBody .x-panel-body { background-image: url("https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png"); background-repeat: no-repeat; background-position: center; } 1 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.