Jump to content

FieldLabel property of the Uniedit component, can I make this description color according


pro_imaj

Recommended Posts

5 hours ago, Sherzod said:

Hello, 

Do you mean FieldLabel font color?

No, I already know that.
What I want to tell is; When the cursor is positioned in Edit, the user understands that the cursor is there with a color. Can this color be brought around the FieldTex part as well?

*Color changes according to the theme. In the attached picture, there is a yellow color according to the aria theme, I want this color to be in the fieldtext so that the user can understand which field is filling.

Link to comment
Share on other sites

On 8/11/2022 at 12:11 PM, Sherzod said:
On 8/10/2022 at 7:04 PM, pro_imaj said:

image.png.9808f878c26606d612024776f6c85e06.png

I will try to check.

Hello,

Let's try this solution first.
As I see it, not all themes are the same in this regard. Some themes don't have border-color, and some have it closer to white. Or need to take the value of another class, please also analyze. And therefore, there may not be a universal solution.

Solution:

1. MainForm.Script ->

var _themeCSS = Ext.util.CSS.getRule('.x-form-trigger-wrap-default.x-form-trigger-wrap-focus');
if (_themeCSS) {
    var _themeColor = _themeCSS.style['border-color'];
}

2. UniEdit.ClientEvents.UniEvents ->

function afterCreate(sender)
{
    sender.on('focus', function(){if (_themeColor) {this.labelTextEl.setStyle('color', _themeColor)}});
    sender.on('blur', function(){this.labelTextEl.setStyle('color', '')});
}

image.png.59e94e736af0e60f6d44982ea8a4753b.png

  • Thanks 1
Link to comment
Share on other sites

On 8/13/2022 at 9:42 AM, Sherzod said:

Hello,

Let's try this solution first.
As I see it, not all themes are the same in this regard. Some themes don't have border-color, and some have it closer to white. Or need to take the value of another class, please also analyze. And therefore, there may not be a universal solution.

Solution:

1. MainForm.Script ->

var _themeCSS = Ext.util.CSS.getRule('.x-form-trigger-wrap-default.x-form-trigger-wrap-focus');
if (_themeCSS) {
    var _themeColor = _themeCSS.style['border-color'];
}

2. UniEdit.ClientEvents.UniEvents ->

function afterCreate(sender)
{
    sender.on('focus', function(){if (_themeColor) {this.labelTextEl.setStyle('color', _themeColor)}});
    sender.on('blur', function(){this.labelTextEl.setStyle('color', '')});
}

image.png.59e94e736af0e60f6d44982ea8a4753b.png

Hi,

@Sherzod The solution you wrote works perfectly, thank you very much.

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