Suppose I have fetched a list of objects from a database:
[{ "id":0 ,"name":"John", "lastname":"Shell" },{ "id":1,...];
and want to display this data using the dynatable plugin:
data : JSON.stringify(data)
success: function(data,status){
$('#table').dynatable({
dataset:{
records:data
}
})
}
However, I need to change how the 'id' is displayed in the table without altering the original JSON. I want it to appear as 'securityNumber' instead.
<table id="tabela">
<thead>
<th>id</th>
<th>name<th>
<th>last_name<th>
</thead>
</table>
I can't simply replace 'id' because the plugin uses the attribute of the JSON Object to identify column names.
I've experimented with different plugins and consulted the dynatable documentation, but am open to new solutions.
How should I proceed?