Jump to content

Place an image on UniPageControl


artem_niko

Recommended Posts

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;
}

image.png.7666e42edd3d0560464929c14a68992c.png

  • Like 1
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...