Skip to content

Commit

Permalink
hide datatable refresh button on client side datatables.
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigo17 committed Jun 29, 2024
1 parent be92e37 commit 2feb0d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion source/src/main/webapp/js/global/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,7 @@ function TableConfigurationsClientSide(divId, data, aoColumnsFunction, activateP
this.aoColumnsFunction = aoColumnsFunction;
this.aaData = data;
this.aaSorting = aaSorting;
this.bDisplayRefreshButton = false;

if (activatePagination) {
this.lengthMenu = [10, 25, 50, 100];
Expand Down Expand Up @@ -1562,6 +1563,7 @@ function TableConfigurationsServerSide(divId, ajaxSource, ajaxProp, aoColumnsFun
this.ajaxSource = ajaxSource;
this.ajaxProp = ajaxProp;

this.bDisplayRefreshButton = true;
this.processing = true;
this.serverSide = true;
if (lengthMenu === undefined) {
Expand Down Expand Up @@ -1871,7 +1873,9 @@ function createDataTableWithPermissions(tableConfigurations, callbackFunction, o
$("#" + tableConfigurations.divId + "_length").addClass("marginBottom10").addClass("width80").addClass("pull-left");
$("#" + tableConfigurations.divId + "_filter").addClass("marginBottom10").addClass("width150").addClass("pull-left");
$("#" + tableConfigurations.divId + "_filter").find('label').addClass("input-group");
$("#" + tableConfigurations.divId + "_filter").find('label').append("<span class='input-group-btn'><button id='dataTableRefresh' class='buttonObject btn btn-default input-sm' title='Refresh' type='button'><span class='glyphicon glyphicon-refresh'></span></button></span>");
if (tableConfigurations.bDisplayRefreshButton) {
$("#" + tableConfigurations.divId + "_filter").find('label').append("<span class='input-group-btn'><button id='dataTableRefresh' class='buttonObject btn btn-default input-sm' title='Refresh' type='button'><span class='glyphicon glyphicon-refresh'></span></button></span>");
}

$("#dataTableRefresh").click(function () {
$("#" + tableConfigurations.divId).dataTable().fnDraw(false);
Expand Down
4 changes: 1 addition & 3 deletions source/src/main/webapp/js/pages/AppServiceList.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ function initPage() {
displayApplicationList("application", "", "", "");

// configure and create the dataTable
var configurations = new TableConfigurationsServerSide("soapLibrarysTable",
"ReadAppService", "contentTable",
aoColumnsFunc("soapLibrarysTable"), [1, 'asc']);
var configurations = new TableConfigurationsServerSide("soapLibrarysTable", "ReadAppService", "contentTable", aoColumnsFunc("soapLibrarysTable"), [1, 'asc']);
createDataTableWithPermissions(configurations, renderOptionsForAppService, "#soapLibraryList", undefined, true);

$('#testCaseListModal').on('hidden.bs.modal', getTestCasesUsingModalCloseHandler);
Expand Down

0 comments on commit 2feb0d2

Please sign in to comment.