trying to change row background color please
trying to change row background color please
Hi, sorry for my english.
I'm trying to change the color of a row depending on the value of a cell (Statut).
the background of the row will change after each change of the cell on column 14 (Statut).
I'm using datatables on a theme called adminica which integrate datatable, here is my code :
[code]function adminicaDataTables() {
if ($(".datatable").length > 0 && $.fn.dataTable) {
var e = $("#dt1 .datatable").dataTable({
bJQueryUI: true,
sScrollX: "",
bSortClasses: true,
aaSorting: [
[0, "desc"]
],
bAutoWidth: true,
sAjaxSource: "get_data.php",
bInfo: true,
sScrollX: "101%",
bScrollCollapse: !0,
sPaginationType: "full_numbers",
bRetrieve: true,
sScrollX: "101%",
fnRowCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
if (aData[14] == "ok") {
$(nRow).css('background-color', 'red').css('font-style', 'italic');
}
}
}) [...][/code]
Thanks a lot...
I'm trying to change the color of a row depending on the value of a cell (Statut).
the background of the row will change after each change of the cell on column 14 (Statut).
I'm using datatables on a theme called adminica which integrate datatable, here is my code :
[code]function adminicaDataTables() {
if ($(".datatable").length > 0 && $.fn.dataTable) {
var e = $("#dt1 .datatable").dataTable({
bJQueryUI: true,
sScrollX: "",
bSortClasses: true,
aaSorting: [
[0, "desc"]
],
bAutoWidth: true,
sAjaxSource: "get_data.php",
bInfo: true,
sScrollX: "101%",
bScrollCollapse: !0,
sPaginationType: "full_numbers",
bRetrieve: true,
sScrollX: "101%",
fnRowCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
if (aData[14] == "ok") {
$(nRow).css('background-color', 'red').css('font-style', 'italic');
}
}
}) [...][/code]
Thanks a lot...
This discussion has been closed.
Replies