datatables retrieve value not shown in table

1

I have a table generated by datatables that shows name, document, and phone. It works perfectly more I want it to appear tooltip to show additional information, I even managed to show taking the value inserted in the tr plus the problem and that the additional information will not appear and I need help for this because my knowledge of the library is limited, it follows below the code:

table:

                  <table id="tabelaclientes" class="table table-bordered table-striped">
                <thead>
                  <tr>
                    <th>Nome</th>
                    <th>Documento</th>
                    <th>Telefone</th>
                    <th></th>
                  </tr>
                </thead>
              </table>

jquery:

    $(document).ready(function() {
/*
 * First step is to create title attributes for the rows in the table
 * This isn't needed if the required 'title' attribute is already set in the HTML in the
 * DOM 
 */


/* Init DataTables */
var oTable = $('#tabelaclientes').DataTable({
        "lengthMenu": [ [10, 25, 50, 100, -1], [10, 25, 50, 100, "Todos"] ],
        "processing": true,
        "serverSide": true,
        "oLanguage": {
            "sUrl": "busca/pt-br.txt"
        },

        "ajax": "busca/clientes.php",

        "fnDrawCallback": function( settings ) {
     $('#tabelaclientes tbody tr').each( function() {
    var sTitle;
    var nTds = $('td', this);
    var nome = $(nTds[0]).text(); 
    var documento = $(nTds[1]).text();
    var telefone = $(nTds[2]).text();
    var ie = $(nTds[4]).text();
    var endereco = $(nTds[5]).text();
    var bairro = $(nTds[6]).text();
    var uf = $(nTds[7]).text();
    var cidade = $(nTds[8]).text();
    var email = $(nTds[9]).text();
        sTitle =  'Nome da Empresa: ' +nome+ '\nCPF/CNPF: ' +documento+ '\nIE: ' +ie+ '\nEndereço: ' +endereco+ '\nBairro: ' +bairro+ '\nUF: ' +uf+ '\nCidade: ' +cidade+ '\nTelefone: ' +telefone+ '\nEmail: ' +email;


    this.setAttribute( 'title', sTitle );
} );
}

    });

/* Apply the tooltips */
oTable.$('tr').tooltip( {
    "delay": 0,
    "track": true,
    "fade": 250
} );

});

I get the data like this:

{"draw":1,"recordsTotal":821,"recordsFiltered":821,"data":[["3 MARC IMPRESSOS GRAFICOS LTDA ME","02651657000144"
,null,"<a class='editar fancybox.iframe' href='cadastro_editar.php?id=574'><img src='imagens\/editar
.png' width='24px' height='24px' border=0  title='Editar acesso'\/><\/a><a class='permissao fancybox
.iframe' href='usuario_permissao.php?id=574'><img src='imagens\/recurso.png' width='24px' height='24px'
 border=0  title='Editar ficha pessoal'\/><\/a>",null,"R JOAO PINHEIRO, 613",null,"RJ",null,null]]}
    
asked by anonymous 23.07.2016 / 17:13

1 answer

0

After much searching I found a solution to this question and I come back here to share so that if anyone else has this problem I can solve it.

Replace this:

var endereco = $(nTds[5]).text();

so:

var endereco = oTable.row(this).data()[5]; 

As the value was hidden in the table I could not pick the same way by selecting td.

    
24.07.2016 / 17:01