The following JavaScript works fine if I pass
t_dataSet into DataTable but does not work (e.g no data) if I instead pass
this.dataSet.
define( ['jquery', 'https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js'], function($, Datatables) {
"use strict";
function DatatablesSimpleList() {}
DatatablesSimpleList.prototype.draw = function( oControlHost ) {
let htmlElement = oControlHost.container;
htmlElement.innerHTML = '<table id="datatable_example" class="display" width="100%"></table>';
var t_dataSet = [
[ "Tiger Nixon" ],
[ "Garrett Winters"],
[ "Ashton Cox"]
];
$(function () {
$('#datatable_example').DataTable({
data: t_dataSet,
columns: [{ title: "Name" }]
});
});
};
DatatablesSimpleList.prototype.setData = function( oControlHost, oDataStore ) {
this.dataSet = [
[ "Tiger Nixon" ],
[ "Garrett Winters"],
[ "Ashton Cox"]
];
};
return DatatablesSimpleList;
});
Any ideas on why this is not working as expected?
------------------------------
Patrick Garner
------------------------------
#CognosAnalyticswithWatson