|
|
@@ -40,11 +40,17 @@ function initializeDataTable() {
|
|
|
dataTableHeadersConfig.forEach(function (headerColumn, columnIndex){
|
|
|
if(headerColumn.type === "action")
|
|
|
{
|
|
|
- let buttonUrl = dataTableColumnsConfig[columnIndex].buttonUrl;
|
|
|
- let parameters = dataTableColumnsConfig[columnIndex].querystring_parameters;
|
|
|
+ console.log("tyson"+columnIndex);
|
|
|
+ let actionButtons = dataTableColumnsConfig[columnIndex].actionButtons;
|
|
|
+ let renderBody = '';
|
|
|
+ renderBody = `if (type === "display") {console.log(row);`;
|
|
|
+ renderBody += `return '`;
|
|
|
+ actionButtons.forEach(function (actionButton){
|
|
|
+ let buttonUrl = actionButton.buttonUrl;
|
|
|
+ let parameters = actionButton.querystring_parameters;
|
|
|
console.log(parameters);
|
|
|
- let renderBody = `if (type === "display") {console.log(row);`;
|
|
|
- renderBody += `return '<button class="action-button" onclick="doActionButton(`;
|
|
|
+
|
|
|
+ renderBody += `<button class="action-button" onclick="doActionButton(`;
|
|
|
renderBody += `\\'`+buttonUrl;
|
|
|
parameters.forEach(function (parameter, index){
|
|
|
if(index === 0)
|
|
|
@@ -70,7 +76,9 @@ function initializeDataTable() {
|
|
|
|
|
|
})
|
|
|
renderBody += `\\'`;
|
|
|
- renderBody += ")\">"+dataTableColumnsConfig[columnIndex].buttonText+"</button>'}return data;";
|
|
|
+ renderBody += ")\">"+actionButton.buttonText+"</button> ";
|
|
|
+ });
|
|
|
+ renderBody += "'}return data;";
|
|
|
renderFunctions[columnIndex] = new Function('data', 'type', 'row', 'meta', renderBody);
|
|
|
console.log(renderFunctions[columnIndex]);
|
|
|
dataTableColumnsConfig[columnIndex].searchable = false;
|