I was using Table, but I had to leave the header fixed. I saw that the DataGrid package does this, so I bought this package. With Table I set the background color of the line with the code below. That is, depending on the value of the column I want the row to change the background color. How to do this in DataGrid?
DataTables::create(array(
"dataSource" => $this->dataStore("orcamento"),
"options" => array(
"fixedHeader" => true,
),
"columns" => $this->campos,
"cssClass" => array(
"table" => "cell-border",
"tr" => function ($row) {
if ($row['ordem'] == 7) {
return "DespesasDiaCss";
} else if ($row['ordem'] == 8) {
return "LiquidoCss";
} else if ($row['is_quebra'] == 1) {
return "QuebraTituloCss";
} else if ($row['is_total_geral'] == 1) {
return "QuebraTotalGeralCss";
} else if ($row['is_total_quebra'] == 1) {
return "QuebraTotalCss";
} else if ($row['is_empresa'] == 1) {
return "isEmpresaCss";
}
}
)
));