About ajax data and datatable object

About ajax data and datatable object

yu yen kanyu yen kan Posts: 65Questions: 31Answers: 0

I using a datatable that load data by ajax

var table= $('#table').DataTable({
    ajax: "server url",
    column: [ {data: 'id', title:'my id'} ]
});

ajax response is only contain id;

is that possible my datatable using below object?

function object(id){
    this.id = id;

    this.idString = function(){
       return "#" + id;
    }
}

Answers

  • kthorngrenkthorngren Posts: 21,364Questions: 26Answers: 4,956

    If I understand your question correctly you probably want to use columns.render to prefix the # to your ID.

    Kevin

This discussion has been closed.