How to add a object with row.add()

How to add a object with row.add()

buhm4nnbuhm4nn Posts: 2Questions: 1Answers: 0

Hi!

I found this example in the documentation: https://datatables.net/reference/api/rows.add%28%29
Can somebody show me how the Pupil object is defined? I would like to use width row.add() which also accepts an object as parameter.

I thought it would be something like:
Pupil = function(id){
id = id;
name = 'foo';
}

But it's not working.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited July 2014 Answer ✓

    The last example in the columns.render documentation shows how it could be done with a complete example.

    Allan

  • buhm4nnbuhm4nn Posts: 2Questions: 1Answers: 0

    Thank you allan! That's exactly what i was looking for.

This discussion has been closed.