Hi
I have to scripts in my app.
The fisrt one, runs just fine.
The second, simply ignores the first "if" hipoteses.
the code is below:
$(document).on('knack-view-render.view_20', function(event, view, data) {
$("#view_20 td.field_2").each(function() {
var textColor = ($(this).find("span").text().trim() == "Não") ? "#ff0000" : "#1c631f"; // #ff0000 is red and the #1c631f is green
$(this).css("color", textColor);
})
});
$(document).on('knack-view-render.view_20', function(event, view, data) {
$("#view_20 td.field_4").each(function() {
if (parseInt($(this).val(), 10) > 50) {
$(this).css('color', 'red');
alert("deu certo");
}
else {
$(this).css('color', 'blue');
var texto = ("deu errado" );
alert(texto); } // #ff0000 is red and the #1c631f is green
});
});
The alert is only designed to check the if conditions.
Thanks for any help.