Jump to content

Center ClearButton for TUniEdit


GerhardV

Recommended Posts

I have some TUniEdits that have a height greater than that of the standard size. The ClearButton is not vertically centered, see attachment. The ClearButton has a element style="right: 7px; top: 1px" in the div tag. It also has margin-top: 4px in the clearbutton.css file but I cannot change the CSS as that will affect all ClearButtons.

 

I checked the TUniEdit source code but there is only one property to set it visible, and it seems that it is declared in TUniFormControl which we don't have the source code for.

 

Is there a way to set the position?

 

Or even better - Can wee perhaps expose properties to set its position? Or can we maybe have it aligned vertically centered?

post-4617-0-65580500-1489309430_thumb.png

Link to comment
Share on other sites

Hi,

 

One possible solution, can you try this?:

 

UniEdit -> ClientEvents -> ExtEvents -> function afterrender:

function afterrender(sender, eOpts)
{
    sender.plugins.forEach(function(p) {
        if (p.alias[0] == "plugin.clearbutton") {
            var h=sender.getHeight()/2;
            var h1=p.clearButtonEl.getHeight()/2;
            p.clearButtonEl.setStyle("margin-top", h-h1);
        }
    });
}

Best regards.

  • Upvote 1
Link to comment
Share on other sites

  • 11 months later...

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...