How to render multiple data sources in the same column?
How to render multiple data sources in the same column?

I've got a certain column that requires me to build a URL using 4-5 data sources from a JSON file. I'm currently using the columns.render option to accomplish similar for another column, but that one only requires a single data source. This is what i'm using for the single data source column render:
{ data: 'id', render: function ( data, type, row, meta ) {
return '<a href="id='+data+'&modal" target="_blank">View</a>';}}
So how would I accomplish this same thing, but with say 4 separate data sources? Ive tried using data[0], data[1], etc and setting data to null, but they just come back as undefined. Anyone have any experience with this?
This question has an accepted answers - jump to answer
Answers
Based on your other thread you are using objects with
columns.data
. usingdata[0]
is to access an array based structure. You need to use something likedata.myKey
ordata[myKay]
.Kevin
Thank you
this worked, and my project is coming together quite nicely!