How to "hardcode" a column while retrieving the other columns with AJAX

How to "hardcode" a column while retrieving the other columns with AJAX

uskerineuskerine Posts: 33Questions: 15Answers: 0

Hi,

I am succesfully retrieving data from AJAX into datatables with:

"ajax": {"url": "getMyData"},
columns: [{ data: 'id' },{ data: 'serie' },{ data: 'foo' }]

However, I would like to hardcode a value (say <a href="goThere.html"></a>) in last column, is there any way to do it without doing it on the server side?

Answers

  • uskerineuskerine Posts: 33Questions: 15Answers: 0

    I finally solved it by adding:

    "columnDefs": [ 
                {
                    "targets": [ 6 ],
                    "data": null,
                    "defaultContent": 
                            'myFooHardcodedContent'
                },
    
This discussion has been closed.