Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81992

Adding data attributes depending on ajax data

$
0
0

Hello.
I want to pass a data to my Datatable with structure like this

[{mainValue: 1, additionalValue: 'one'}, {mainValue: 2, additionalValue: 'two'}... and so on] 

and then in resulting table get a cells in format like this (adding main value as text inside a cell and second value as data-attribute):

<td data-value="one">1</td>
<td data-value="two">2</td>

I know. that I can export 'mainValue' by columns.data option but how can I adding data-attribute with additional value?


Viewing all articles
Browse latest Browse all 81992

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>