Jump to content

Add css in uniEdit dynamically


robinhodemorais

Recommended Posts

Hello, I created the css below for certain validations in uniedit, so you need to leave it dynamic, that is, activate when for some condition.

.campoVazio {
  border-color: red !important;
  box-shadow: 0 3px 4px rgb(255 0 0 / 16%), 0 3px 4px rgb(255 0 0 / 23%);
}

For this I'm trying to do the following way

 UniSession.AddJS('$(''#'+edCliente.JSId+''').addClass(''campoVazio'')');

When you call the command above, the field doesn't have the css, how can I do it?

and taking advantage, to disappear when necessary manually, how could I do it?

Link to comment
Share on other sites

it worked perfectly, thank you. How do I remove? I tried to pass the parameter [] empty with JSCall but it wasn't, this way below works, but when I click on the field it comes back, how can I remove it?

 

UniSession.AddJS('$(''#'+edCliente.JSId+''').removeClass(''campoVazio'')');

 

Link to comment
Share on other sites

Thanks, just one more question I'm racking my brain here; In css I put the border-color: #red !important; but the border isn't turning red, it's just with the shading of the css. Look through the browser inspector I noticed that I would have to change the css of x-form-trigger-wrap-default, but if I do that changes all fields, I would have to change only this specific one. the theme i'm using is the crisp.

 

Screenshot_15.png

Link to comment
Share on other sites

23 minutes ago, robinhodemorais said:

just one more question I'm racking my brain here; In css I put the border-color: #red !important; but the border isn't turning red, it's just with the shading of the css. Look through the browser inspector I noticed that I would have to change the css of x-form-trigger-wrap-default, but if I do that changes all fields, I would have to change only this specific one. the theme i'm using is the crisp.

If I understand you correctly, also set the following css rules to your style:

border-width: 1px;
border-style: solid;
border-color: red;

 

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