diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/DatatablesNet/DatatablesNetScriptContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/DatatablesNet/DatatablesNetScriptContributor.cs index daea15328f..2ad3bb2bdb 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/DatatablesNet/DatatablesNetScriptContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/DatatablesNet/DatatablesNetScriptContributor.cs @@ -10,6 +10,14 @@ public class DatatablesNetScriptContributor : BundleContributor { public override void ConfigureBundle(BundleConfigurationContext context) { - context.Files.AddIfNotContains("/libs/datatables.net/js/jquery.dataTables.js"); + if (context.FileProvider.GetFileInfo("/libs/datatables.net/js/dataTables.min.js").Exists) + { + context.Files.AddIfNotContains("/libs/datatables.net/js/dataTables.min.js"); + } + else + { + //TODO: Compatible code, Remove it after 8.3 rc1. + context.Files.AddIfNotContains("/libs/datatables.net/js/jquery.dataTables.js"); + } } } 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 b4000d6cbc..9b5b29d70b 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 @@ -240,10 +240,17 @@ var abp = abp || {}; if (tableInstance.aoColumns) { columns = tableInstance.aoColumns; - } else { + } else if (abp.utils.isFunction(tableInstance.fnSettings)) { columns = tableInstance.fnSettings().aoColumns; } + if (!columns && abp.utils.isFunction(tableInstance.api)) { + var settings = tableInstance.api().settings(); + if (settings.length === 1 && settings[0].aoColumns) { + columns = settings[0].aoColumns; + } + } + if (!columns) { return; } @@ -271,8 +278,9 @@ var abp = abp || {}; } }; - var _existingApiRenderRowActionsFunction = $.fn.dataTableExt.oApi.renderRowActions; - $.fn.dataTableExt.oApi.renderRowActions = + if ($.fn.dataTableExt.oApi) { + var _existingApiRenderRowActionsFunction = $.fn.dataTableExt.oApi.renderRowActions; + $.fn.dataTableExt.oApi.renderRowActions = function (tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull) { if (_existingApiRenderRowActionsFunction) { _existingApiRenderRowActionsFunction(tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull); @@ -280,7 +288,8 @@ var abp = abp || {}; renderRowActions(tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull); }; - + } + if (!$.fn.dataTable) { return; } diff --git a/npm/packs/datatables.net-bs5/package.json b/npm/packs/datatables.net-bs5/package.json index 1e5f56ac9d..e3ec453fd1 100644 --- a/npm/packs/datatables.net-bs5/package.json +++ b/npm/packs/datatables.net-bs5/package.json @@ -6,7 +6,7 @@ }, "dependencies": { "@abp/datatables.net": "~8.1.1", - "datatables.net-bs5": "^1.11.4" + "datatables.net-bs5": "^2.0.2" }, "gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431", "homepage": "https://abp.io", diff --git a/npm/packs/datatables.net/abp.resourcemapping.js b/npm/packs/datatables.net/abp.resourcemapping.js index 53561d1e3e..4c5147ec27 100644 --- a/npm/packs/datatables.net/abp.resourcemapping.js +++ b/npm/packs/datatables.net/abp.resourcemapping.js @@ -1,5 +1,6 @@ module.exports = { mappings: { - "@node_modules/datatables.net/js/jquery.dataTables.js": "@libs/datatables.net/js/" + "@node_modules/datatables.net/js/dataTables.min.js": "@libs/datatables.net/js/", + "@node_modules/datatables.net/js/jquery.dataTables.js": "@libs/datatables.net/js/" //TODO: Compatible code, Remove it after 8.3 rc1. } } \ No newline at end of file diff --git a/npm/packs/datatables.net/package.json b/npm/packs/datatables.net/package.json index 201148038c..913778c275 100644 --- a/npm/packs/datatables.net/package.json +++ b/npm/packs/datatables.net/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@abp/jquery": "~8.1.1", - "datatables.net": "^1.11.4" + "datatables.net": "^2.0.2" }, "gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431", "homepage": "https://abp.io",