Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: Border thickness based on variable  (Read 2935 times)

Paul

  • Newbie
  • *
  • Posts: 3
    • View Profile
Border thickness based on variable
« on: August 09, 2021, 09:27:27 pm »
Is it possible to change textitem border according variable value?
For example like:
if(dataset.border == 1)
{
  border-top = 1;
}
else
{
  border-top = 0;
}

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1005
    • View Profile
Re: Border thickness based on variable
« Reply #1 on: August 11, 2021, 05:35:58 pm »
Hi!
You can do something like this:

$S{
Borders = {
  "top":1,
  "bottom":2,
  "left":4,
  "right":8,   
  "all": 15
}

if (borderOn){
   THIS.borders = Borders.top // it could be THIS.borders = Borders.all or THIS.borders = Borders.top + Borders.bottom
} else {
   THIS.borders = 0
}
}