Change the background color of a particular row.

Change the background color of a particular row.

joao_oliveirajoao_oliveira Posts: 32Questions: 0Answers: 0
edited November 2013 in General
How to change the background color of a given row, according to the contents of a cell?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Please don't post the same question multiple times - as noted int he forum rules. It just uses my time and your time up. See your duplicate question here: http://datatables.net/forums/discussion/18173

    Allan
  • joao_oliveirajoao_oliveira Posts: 32Questions: 0Answers: 0
    Show me an example?

    thank you!!!
  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    http://datatables.net/ref#fnCreatedRow
  • joao_oliveirajoao_oliveira Posts: 32Questions: 0Answers: 0
    $(document).ready(function() {

    var oTable = $('#tbleitos').dataTable( {
    "bPaginate": false,
    "bLengthChange": false,
    "bFilter": false,
    //classificação de colunas
    "bSort": false,
    "bInfo": false,
    //largura inteligente
    "bAutoWidth": false,
    //envio de mensagens do Display
    "oLanguage":
    {
    "sProcessing": "Aguarde enquanto os dados são carregados…",
    //"sLengthMenu": "",
    "sZeroRecords": " NÃO EXISTEM DADOS DE CIRURGIAS LANÇADOS ATÉ O MOMENTO - FAVOR PROCURAR A ENFERMAGEM. ",
    },
    //configuração das colunas
    "aoColumns" : [ {
    "sWidth": "10px"},
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null],


    "bProcessing": false,
    "bServerSide": true,
    //Aatualização em real-time
    "sAjaxSource": "consulta_cirurgias.php?sEcho=0" } );

    setInterval(function()
    {
    //oTable.fnReloadAjax("consulta_teste.php?sEcho=1");
    oTable.fnDraw();
    //dataTable.fnCreatedRow("consulta_teste.php?sEcho=1");
    //$('table.dataTable td').css('font-size', 70);
    },3000);
    //3 segundos
    } );

    var addId = $j('#tbleitos').dataTable().fnAddData([
    'col1',
    'col2',
    'col3',
    'col4',
    'col5',
    'col6',
    'col7',
    'col8',
    'col9',
    'col10',
    'col11',
    'col12',
    ]);









    HORA INICIAL
    HORA FINAL
    SALA
    PACIENTE
    IDADE
    CONVENIO
    LEITO
    CIRURGIAO
    ANESTESISTA
    PROCEDIMENTO
    CIRCULANTE
    STATUS
  • joao_oliveirajoao_oliveira Posts: 32Questions: 0Answers: 0
    How could I implement this in my project? I have many doubts.
  • joao_oliveirajoao_oliveira Posts: 32Questions: 0Answers: 0
    Eu não uso TR ou TD no HTML, meus dados são pegos do banco Oracle.
  • joao_oliveirajoao_oliveira Posts: 32Questions: 0Answers: 0
    I do not use TR or TD in HTML, my data are taken from the Oracle database.
  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    How can you have a HTML table without TR or TD? It doesn't matter where your data comes from, it has to be displayed in valid HTML.
  • joao_oliveirajoao_oliveira Posts: 32Questions: 0Answers: 0
    My data source is AJAX
  • joao_oliveirajoao_oliveira Posts: 32Questions: 0Answers: 0
    you know not solve it, nobody here knows workaround.
This discussion has been closed.