pythontr.com
.yellow { background:yellow; }
$("#flexReklam").flexigrid ( { .................bla bla bla onSuccess: gridFormat, singleSelect: true });
function gridFormat(){ var i=0; for (i=0;i < document.getElementById("flexReklam").rows.length;i++) { var table=document.getElementById("flexReklam"); // hücreler 0 dan başlar // Biz kontrol edeceğimiz alanı hide olarak ekledik ve column numarası 1 dir. var durum_kontrol=table.rows[i].cells[1].firstChild.innerHTML; if (durum_kontrol=="1") { table.rows[i].cells[2].firstChild.style.backgroundColor="yellow"; table.rows[i].classList.remove("erow"); table.rows[i].classList.add("yellow"); // table.rows[i].cells[1].firstChild.style.backgroundColor="#FF0"; // table.rows[i].style.backgroundColor="#FF0"; } if (durum_kontrol=="2") { // table.rows[i].cells[1].firstChild.style.backgroundColor="#00FF00"; // table.rows[i].style.backgroundColor="#00FF00"; table.rows[i].cells[1].firstChild.style.backgroundColor="green"; table.rows[i].classList.remove("erow"); table.rows[i].classList.add("green"); } } }
Yorumlar