QUESTION:
I don't understand why the 'contentType' parameter cannot be found. I have it spelled correctly. I'm assuming I'm not setting the parameters correctly.
Any ideas?
ERROR:
DataTables warning: table id=attachment - Requested unknown parameter 'contentType' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4
JSON:
[{
"_data$p$0": {
"id": "AAMkADU4MzkxN2RmLTdiZS53ao=",
"name": "somefile.xlsx",
"contentType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"size": 43069,
"attachmentType": 0,
"isInline": false
}
}]
JAVASCRIPT:
Office.initialize = function (reason) {
$(document).ready(function () {
app.initialize();
window.alert = function (message) { app.showNotification("DataTable", message); };
var attachments = localStorage.getItem("Attachments");
console.log(attachments);
// Display Table
$('#attachment').DataTable({
data: attachments,
columns: [
{ data: 'contentType' },
{ data: 'name' }
]
});
});
};
HTML:
<table id="attachment" class="display">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
</tr>
</thead>
</table>