Jump to content

How To Left Align Caption For TUniCheckBox / TUniDBCheckBox And TUniRadioButton / TUniDBRadioButton?


Frederick

Recommended Posts

2 hours ago, Frederick said:

The above controls do not seem to have a way for the caption to appear to the left of the circle or square graphic.

Is there a way to do this per the attached image?

Have you tried using FieldLabel instead of Caption

Link to comment
Share on other sites

I tried the FieldLabel property and it seems to fit the requirement but why is it not visual in the IDE?

In addition, there are no field label properties for the TUniRadioButton control. Is there a reason for this?

I also see that there is no TUniDBRadioButton control. It would be great to have this as it makes for better placement of controls.

Link to comment
Share on other sites

5 hours ago, Frederick said:

I tried the FieldLabel property and it seems to fit the requirement but why is it not visual in the IDE?

 

13 hours ago, Frederick said:

Is there a way to do this per the attached image?

You can try to use this approach I think.

For example for UniCheckBox,

UniCheckBox.ClientEvents.ExtEvents - > function afterrender:

function afterrender(sender, eOpts)
{
    var me = sender;
    me.displayEl.setStyle('left', me.boxLabelEl.getWidth() - 10 + 'px');
    //or me.getWidth()-10 + 'px');
    
    me.boxLabelEl.setStyle('padding-left', '0px');
}

 

Link to comment
Share on other sites

Just now, Frederick said:

I placed a TUniDBRadioGroup control on a form, added some items and then added the above AfterRender code.

When  I call the form's ShowModal, it refused to display and eventually became unresponsive.

Can you please make a simple tescase for this? I will check.

Link to comment
Share on other sites

21 minutes ago, Frederick said:

Sure, please find attached.

radiogroup.zip

function afterrender(sender, eOpts)
{
    sender.getEl().query('.x-form-type-radio').forEach(function(cmp) {
        me = Ext.getCmp(cmp.id);
        me.displayEl.setStyle('left', me.boxLabelEl.getWidth() - 10 + 'px');
        //or me.getWidth()-10 + 'px');
        me.boxLabelEl.setStyle('padding-left', '0px');

    });
}

 

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