diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js index 40aebbc71f..e8489ad62c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js @@ -8,8 +8,8 @@ }; /************************************************************************ - * RECORD-ACTIONS extension for datatables * - *************************************************************************/ + * RECORD-ACTIONS extension for datatables * + *************************************************************************/ (function () { if (!$.fn.dataTableExt) { return; @@ -226,8 +226,8 @@ })(); /************************************************************************ - * AJAX extension for datatables * - *************************************************************************/ + * AJAX extension for datatables * + *************************************************************************/ (function () { datatables.createAjax = function (serverMethod, inputAction) { return function (requestData, callback, settings) { @@ -275,8 +275,8 @@ })(); /************************************************************************ - * Configuration/Options normalizer for datatables * - *************************************************************************/ + * Configuration/Options normalizer for datatables * + *************************************************************************/ (function () { var customizeRowActionColumn = function (column) { @@ -291,7 +291,7 @@ datatables.normalizeConfiguration = function (configuration) { - configuration.scrollX = true; + configuration.scrollX = datatables.defaultConfigurations.scrollX; for (var i = 0; i < configuration.columnDefs.length; i++) { var column = configuration.columnDefs[i]; @@ -304,34 +304,22 @@ } } - configuration.language = { - info: localize("PagerInfo"), - infoFiltered: localize("PagerInfoFiltered"), - infoEmpty: localize("PagerInfoEmpty"), - search: localize("PagerSearch"), - processing: localize("ProcessingWithThreeDot"), - loadingRecords: localize("LoadingWithThreeDot"), - lengthMenu: localize("PagerShowMenuEntries"), - emptyTable: localize("NoDataAvailableInDatatable"), - paginate: { - first: localize("PagerFirst"), - last: localize("PagerLast"), - previous: localize("PagerPrevious"), - next: localize("PagerNext") - } - }; + configuration.language = datatables.defaultConfigurations.language; - configuration.dom = '<"dataTable_filters"f>rt<"row dataTable_footer"<"col-auto"l><"col-auto"i><"col"p>>'; + if(configuration.dom){ + configuration.dom += datatables.defaultConfigurations.dom; + }else{ + configuration.dom = datatables.defaultConfigurations.dom; + } return configuration; }; - })(); /************************************************************************ - * Default Renderers * - *************************************************************************/ - + * Default Renderers * + *************************************************************************/ + datatables.defaultRenderers = datatables.defaultRenderers || {}; datatables.defaultRenderers['boolean'] = function(value) { @@ -356,4 +344,31 @@ .toLocaleString(luxon.DateTime.DATETIME_SHORT); }; -})(jQuery); \ No newline at end of file + /************************************************************************ + * Default Configurations * + *************************************************************************/ + + datatables.defaultConfigurations = datatables.defaultConfigurations || {}; + + datatables.defaultConfigurations.scrollX = true; + + datatables.defaultConfigurations.language = { + info: localize("PagerInfo"), + infoFiltered: localize("PagerInfoFiltered"), + infoEmpty: localize("PagerInfoEmpty"), + search: localize("PagerSearch"), + processing: localize("ProcessingWithThreeDot"), + loadingRecords: localize("LoadingWithThreeDot"), + lengthMenu: localize("PagerShowMenuEntries"), + emptyTable: localize("NoDataAvailableInDatatable"), + paginate: { + first: localize("PagerFirst"), + last: localize("PagerLast"), + previous: localize("PagerPrevious"), + next: localize("PagerNext") + } + }; + + datatables.defaultConfigurations.dom = '<"dataTable_filters"f>rt<"row dataTable_footer"<"col-auto"l><"col-auto"i><"col"p>>'; + +})(jQuery);