|
|
@@ -35,7 +35,7 @@ function initializeDataTable() {
|
|
|
{
|
|
|
if(key === "exportOptions")
|
|
|
{
|
|
|
- console.log('Export Check');
|
|
|
+
|
|
|
buttonConfig.exportOptions.format = {
|
|
|
header: function (data){
|
|
|
const tempDiv = document.createElement('div');
|
|
|
@@ -64,15 +64,13 @@ function initializeDataTable() {
|
|
|
dataTableHeadersConfig.forEach(function (headerColumn, columnIndex){
|
|
|
if(headerColumn.type === "action")
|
|
|
{
|
|
|
- console.log("tyson"+columnIndex);
|
|
|
let actionButtons = dataTableColumnsConfig[columnIndex].actionButtons;
|
|
|
let renderBody = '';
|
|
|
- renderBody = `if (type === "display") {console.log(row);`;
|
|
|
+ renderBody = `if (type === "display"){`;
|
|
|
renderBody += `return '`;
|
|
|
actionButtons.forEach(function (actionButton){
|
|
|
let buttonUrl = actionButton.buttonUrl;
|
|
|
let parameters = actionButton.querystring_parameters;
|
|
|
- console.log(parameters);
|
|
|
|
|
|
renderBody += `<button class="action-button" onclick="doActionButton(`;
|
|
|
renderBody += `\\'`+buttonUrl;
|
|
|
@@ -104,7 +102,6 @@ function initializeDataTable() {
|
|
|
});
|
|
|
renderBody += "'}return data;";
|
|
|
renderFunctions[columnIndex] = new Function('data', 'type', 'row', 'meta', renderBody);
|
|
|
- console.log(renderFunctions[columnIndex]);
|
|
|
dataTableColumnsConfig[columnIndex].searchable = false;
|
|
|
dataTableColumnsConfig[columnIndex].orderable = false;
|
|
|
dataTableColumnsConfig[columnIndex].render = renderFunctions[columnIndex];
|
|
|
@@ -124,16 +121,12 @@ function initializeDataTable() {
|
|
|
url: '/api/report-data/' + dataTableName,
|
|
|
type: 'POST',
|
|
|
dataSrc: function (json) {
|
|
|
- //console.log('Returned data:', json);
|
|
|
//populate any dropdown headers
|
|
|
- //console.log(dataTableHeadersConfig);
|
|
|
dataTableHeadersConfig.forEach(function(headerConfig, index){
|
|
|
|
|
|
if(headerConfig.searchtype == "dropdown")
|
|
|
{
|
|
|
- //console.log('Tyson here');
|
|
|
var dropdown = $('#'+headerConfig.header.replace(' ', '-')+'FilterDropdown');
|
|
|
- //console.log(dropdown);
|
|
|
dropdown.empty().append($('<option>',{
|
|
|
value: '',
|
|
|
text: '-- Not Filtered --'
|
|
|
@@ -143,7 +136,6 @@ function initializeDataTable() {
|
|
|
if(json.searchterms && json.searchterms[index]){
|
|
|
Object.keys(searchTerms[index]).forEach(function (key){
|
|
|
var searchValue = searchTerms[index][key]
|
|
|
- console.log('value: '+searchValue)
|
|
|
if(option === searchValue)
|
|
|
{
|
|
|
selected = true;
|
|
|
@@ -173,7 +165,6 @@ function initializeDataTable() {
|
|
|
}
|
|
|
document.addEventListener('livewire:init', function () {
|
|
|
|
|
|
- console.log('Initializing DataTable');
|
|
|
|
|
|
|
|
|
|
|
|
@@ -206,7 +197,6 @@ function getFilterInput(searchTerm, index, searchType, extra){
|
|
|
break;
|
|
|
}
|
|
|
searchTerms[index] = inner;
|
|
|
- console.log(searchTerms[index]);
|
|
|
dataTableInstance.ajax.reload();
|
|
|
|
|
|
|
|
|
@@ -222,7 +212,7 @@ window.getFilterInput = getFilterInput;
|
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
- console.log("reports.js is working!");
|
|
|
+
|
|
|
});
|
|
|
|
|
|
|