I wrote few Java Scripts, mostly for change of text color, depends of value. It is implements in JSF application. Example below:
$(document).ready(function(){
var allCells = $(".kolorStatus > div");
$.each(allCells, function (index, child) {
switch(child.textContent){
case "Produkcja": $(child).parent().css("color", "green");
break;
case "Brak zleceń": $(child).parent().css("color", "black");
break;
case "Brak zlecen": $(child).parent().css("color", "black");
break;
case "Tech. red. prędkości": $(child).parent().css("color", "orange");
break;
default: $(child).parent().css("color", "red");
}
});
});
Script works correct until I refresh from JSF Bean with ajax:
PrimeFaces instance = PrimeFaces.current();
instance.ajax().update("form:gridPanel");
In result there is lack of any colors.