Responsive display [Object Object] on viewport resize

Responsive display [Object Object] on viewport resize

viandanteviandante Posts: 22Questions: 10Answers: 1
edited November 2014 in Free community support

Hi to all!

I have added several buttons in the rows, via the rowCallback.

...
"responsive": true,
"rowCallback": function (nRow, data) {
                    var opts = data.opzioni;
                    var links = "";
                    links = links + '<a data-toggle="modal" data-target="#commentoInstallatoreModal" href="?modulo=Commenti&action=editCommentoInstallatore&ajxRq=1&codice=' + opts.id + '" class="btn btn-default btn-xs" rel="tooltip" data-original-title="Modifica il commento" data-placement="left"><i class="fa fa-edit"></i></a>';
                    links = links + '<a class="delUserComment btn btn-danger btn-xs" data-codice="' + opts.id + '" rel="tooltip" data-original-title="Elimina" data-placement="left" href="#"><i class="fa fa-times"></i></a>';
                    $('td:eq(5)', nRow).html(links);
                }
...

but when i resize the viewport, or change the page, in the fifth column i see [Object Object]

The responsive plugin is loaded...

DT 1.10.4
Plugin 1.0.2

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,044Questions: 1Answers: 9,955 Site admin
    Answer ✓

    Looks like you are using the dt-init rowCallback to format the HTML. I would suggest using columns.render instead. It is far more efficient and should work with Responsive.

    Allan

  • viandanteviandante Posts: 22Questions: 10Answers: 1

    Hi allan,

    Thanks a lot!
    I try this solution immediately

This discussion has been closed.