IS
DATAGRID DESTACAR COR NA LINHA SELECIONA.
Alguém tem ideia de selecionar o datagrid e ativar a linha com uma cor mais forte para destaque. Mas alterar a cor somente quando selecionado, se selecionar outra muda para outra linha e retorna estado normal.
Já tentei esta função não funcionou.
public function onShowDetail( $param )
{
// get row position
$pos = $this->datagrid->getRowIndex('code', $param['key']);
// get row by position
$current_row = $this->datagrid->getRow($pos);
$current_row->style = "background-color: #8D8BC8; color:white; text-shadow:none";
// create a new row
$row = new TTableRow;
$row->style = "background-color: #E0DEF8";
$row->addCell('');
$cell = $row->addCell('In this space, you can add any detail
content about the selected record');
$cell->colspan = 4;
$cell->style='padding:10px;';
// insert the new row
$this->datagrid->insert($pos +1, $row);
}
Problema solucionado, tem que ser colocado apos onReload, no reload sera carregado o datagrid novamente.
Já tentei esta função não funcionou.
public function onShowDetail( $param )
{
// get row position
$pos = $this->datagrid->getRowIndex('code', $param['key']);
// get row by position
$current_row = $this->datagrid->getRow($pos);
$current_row->style = "background-color: #8D8BC8; color:white; text-shadow:none";
// create a new row
$row = new TTableRow;
$row->style = "background-color: #E0DEF8";
$row->addCell('');
$cell = $row->addCell('In this space, you can add any detail
content about the selected record');
$cell->colspan = 4;
$cell->style='padding:10px;';
// insert the new row
$this->datagrid->insert($pos +1, $row);
}
Problema solucionado, tem que ser colocado apos onReload, no reload sera carregado o datagrid novamente.
Editado 20/03/2023 (há 2 anos) - Clique para ver alterações