Respectfully request some assistance. For the following conditional format code, does anyone know what the replacement syntax would be for a value greater than (>) or less than or equal to (≤)?
V/r,
----------------------------------
<script>
$j(function(){
$j('.links-datecalc').each(function(){
var datecalc = $j(this).text();
if (datecalc == '9'){
$j(this).addClass('success');
}
if (datecalc == '7'){
$j(this).addClass('info');
}
if (datecalc == '-'){
$j(this).addClass('danger');
}
})
})
</script>
Conditional format that recognizes > than or ≤
-
- Veteran Member
- Posts: 32
- Joined: 2020-06-22 00:00
-
- Veteran Member
- Posts: 32
- Joined: 2020-06-22 00:00
Re: Conditional format that recognizes > than or ≤
FOUND ANSWER
Get rid of the quote around the numerical value.
----SAMPLE SYNTAX----
<script>
$j(function(){
$j('.links-datecalc').each(function(){
var datecalc = $j(this).text();
if (datecalc > 9){
$j(this).addClass('success');
}
if (datecalc < 7){
$j(this).addClass('info');
}
if (datecalc <= -2){
$j(this).addClass('danger');
}
})
})
</script>
Get rid of the quote around the numerical value.
----SAMPLE SYNTAX----
<script>
$j(function(){
$j('.links-datecalc').each(function(){
var datecalc = $j(this).text();
if (datecalc > 9){
$j(this).addClass('success');
}
if (datecalc < 7){
$j(this).addClass('info');
}
if (datecalc <= -2){
$j(this).addClass('danger');
}
})
})
</script>
Re: Conditional format that recognizes > than or ≤
How to format condition for Null value? Neither of these conditions works:
var status = $j(this).text();
a) if(status == 'Null'){
b) if(status == Null){
c) if(status == ''){
var status = $j(this).text();
a) if(status == 'Null'){
b) if(status == Null){
c) if(status == ''){
ver 23.15 1484
Re: Conditional format that recognizes > than or ≤
You can output current value of status-variable to console of your browser's development tools and check it:
Could be:
Jan
Code: Select all
console.log(status);
- undefined
Code: Select all
if (status === undefined) { ... }
- null
Code: Select all
if (status === null) { ... }
- empty string
Code: Select all
if (status === '') { ... }
- or any value or object
Jan
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Conditional format that recognizes > than or ≤
console said undefined, but still no collour
ver 23.15 1484