diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml b/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml
index fe35f568f5..ee386d41e1 100644
--- a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml
+++ b/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml
@@ -9,8 +9,7 @@
@section scripts {
-
-
+
diff --git a/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj b/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj
index e4e756be91..dbc8386f59 100644
--- a/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj
+++ b/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj
@@ -16,10 +16,6 @@
-
-
-
-
diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/datatables.extensions.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/datatables.extensions.js
new file mode 100644
index 0000000000..257f54a795
--- /dev/null
+++ b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/datatables.extensions.js
@@ -0,0 +1,224 @@
+var abp = abp;
+
+(function ($) {
+
+
+ /************************************************************************
+ * RECORD-ACTIONS extension for datatables *
+ *************************************************************************/
+ var recordActions = function() {
+ if (!$.fn.dataTableExt) {
+ return;
+ }
+
+ var _createDropdownItem = function (record, fieldItem) {
+ var $li = $('');
+ var $a = $('');
+
+ if (fieldItem.text) {
+ $a.html(fieldItem.text);
+ }
+
+ if (fieldItem.action) {
+ $a.click(function (e) {
+ e.preventDefault();
+
+ if (!$(this).closest('li').hasClass('disabled')) {
+ fieldItem.action({
+ record: record
+ });
+ }
+ });
+ }
+
+ $a.appendTo($li);
+ return $li;
+ }
+
+ var _createButtonDropdown = function (record, field) {
+ var $container = $('')
+ .addClass('dropdown')
+ .addClass('action-button');
+
+ var $dropdownButton = $('')
+ .html(field.text)
+ .addClass('btn btn-primary btn-sm dropdown-toggle')
+ .attr('data-toggle', 'dropdown')
+ .attr('aria-haspopup', 'true')
+ .attr('aria-expanded', 'false');
+
+ if (field.cssClass) {
+ $dropdownButton.addClass(field.cssClass);
+ }
+
+ var $dropdownItemsContainer = $('').addClass('dropdown-menu');
+
+ for (var i = 0; i < field.items.length; i++) {
+ var fieldItem = field.items[i];
+
+ if (fieldItem.visible && !fieldItem.visible({ record: record })) {
+ continue;
+ }
+
+ var $dropdownItem = _createDropdownItem(record, fieldItem);
+
+ if (fieldItem.enabled && !fieldItem.enabled({ record: record })) {
+ $dropdownItem.addClass('disabled');
+ }
+
+ $dropdownItem.appendTo($dropdownItemsContainer);
+ }
+
+ if ($dropdownItemsContainer.find('li').length > 0) {
+ $dropdownItemsContainer.appendTo($container);
+ $dropdownButton.appendTo($container);
+ }
+
+ if ($dropdownItemsContainer.children().length === 0) {
+ return "";
+ }
+
+ return $container;
+ };
+
+ var _createSingleButton = function (record, field) {
+ $(field.element).data(record);
+
+ if (field.visible === undefined) {
+ return field.element;
+ }
+
+ var isVisibilityFunction = typeof field.visible === "function";
+ if (isVisibilityFunction) {
+ if (field.visible()) {
+ return field.element;
+ }
+ } else {
+ if (field.visible) {
+ return field.element;
+ }
+ }
+
+ return "";
+ };
+
+ var _createRowAction = function (record, field, tableInstance) {
+ if (field.items && field.items.length > 1) {
+ return _createButtonDropdown(record, field, tableInstance);
+ } else if (field.element) {
+ var $singleActionButton = _createSingleButton(record, field);
+ if ($singleActionButton != "") {
+ return $singleActionButton.clone(true);
+ }
+ }
+
+ return "";
+ }
+
+ var hideColumnWithoutRedraw = function (tableInstance, colIndex) {
+ tableInstance.fnSetColumnVis(colIndex, false, false);
+ }
+
+ var hideEmptyColumn = function (cellContent, tableInstance, colIndex) {
+ if (cellContent == "") {
+ hideColumnWithoutRedraw(tableInstance, colIndex);
+ }
+ };
+
+ var renderRowActions = function (tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull) {
+ var columns;
+ if (tableInstance.aoColumns) {
+ columns = tableInstance.aoColumns;
+ } else {
+ columns = tableInstance.fnSettings().aoColumns;
+ }
+
+ if (!columns) {
+ return;
+ }
+
+ var cells = $(nRow).children("td");
+
+ for (var colIndex = 0; colIndex < columns.length; colIndex++) {
+ var column = columns[colIndex];
+ if (column.rowAction) {
+ var $actionContainer = _createRowAction(aData, column.rowAction, tableInstance);
+ hideEmptyColumn($actionContainer, tableInstance, colIndex);
+
+ var $actionButton = $(cells[colIndex]).find(".action-button");
+ if ($actionButton.length === 0) {
+ $(cells[colIndex]).append($actionContainer);
+ }
+ }
+ }
+ };
+
+ var _existingApiRenderRowActionsFunction = $.fn.dataTableExt.oApi.renderRowActions;
+ $.fn.dataTableExt.oApi.renderRowActions = function (tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull) {
+ if (_existingApiRenderRowActionsFunction) {
+ _existingApiRenderRowActionsFunction(tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull);
+ }
+
+ renderRowActions(tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull);
+ };
+
+ if (!$.fn.dataTable) {
+ return;
+ }
+
+ var _existingDefaultFnRowCallback = $.fn.dataTable.defaults.fnRowCallback;
+ $.extend(true, $.fn.dataTable.defaults, {
+ fnRowCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
+ if (_existingDefaultFnRowCallback) {
+ _existingDefaultFnRowCallback(this, nRow, aData, iDisplayIndex, iDisplayIndexFull);
+ }
+
+ renderRowActions(this, nRow, aData, iDisplayIndex, iDisplayIndexFull);
+ }
+ });
+
+ }();
+
+ /************************************************************************
+ * AJAX extension for datatables *
+ *************************************************************************/
+ var ajaxActions = function() {
+ var datatables = abp.utils.createNamespace(abp, 'libs.datatables');
+
+ datatables.createAjax = function(serverMethod, inputAction) {
+ return function(requestData, callback, settings) {
+ var input = inputAction ? inputAction() : {};
+
+ //Paging
+ if (settings.oInit.paging) {
+ input.maxResultCount = requestData.length;
+ input.skipCount = requestData.start;
+ }
+
+ //Sorting
+ if (requestData.order && requestData.order.length > 0) {
+ var orderingField = requestData.order[0];
+ if (requestData.columns[orderingField.column].data) {
+ input.sorting = requestData.columns[orderingField.column].data + " " + orderingField.dir;
+ }
+ }
+
+ //Text filter
+ if (requestData.search && requestData.search.value !== "") {
+ input.filter = requestData.search.value;
+ }
+
+ if (callback) {
+ serverMethod(input).then(function(result) {
+ callback({
+ recordsTotal: result.totalCount,
+ recordsFiltered: result.totalCount,
+ data: result.items
+ });
+ });
+ }
+ }
+ }
+ }();
+
+})(jQuery);
\ No newline at end of file
diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/datatables/datatables.record-actions.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/datatables/datatables.record-actions.js
deleted file mode 100644
index 929b62f54d..0000000000
--- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/datatables/datatables.record-actions.js
+++ /dev/null
@@ -1,176 +0,0 @@
-/************************************************************************
-* RECORD-ACTIONS extension for datatables *
-*************************************************************************/
-(function ($) {
-
- if (!$.fn.dataTableExt) {
- return;
- }
-
- var _createDropdownItem = function (record, fieldItem) {
- var $li = $('');
- var $a = $('');
-
- if (fieldItem.text) {
- $a.html(fieldItem.text);
- }
-
- if (fieldItem.action) {
- $a.click(function (e) {
- e.preventDefault();
-
- if (!$(this).closest('li').hasClass('disabled')) {
- fieldItem.action({
- record: record
- });
- }
- });
- }
-
- $a.appendTo($li);
- return $li;
- }
-
- var _createButtonDropdown = function (record, field) {
- var $container = $('')
- .addClass('dropdown')
- .addClass('action-button');
-
- var $dropdownButton = $('')
- .html(field.text)
- .addClass('btn btn-primary btn-sm dropdown-toggle')
- .attr('data-toggle', 'dropdown')
- .attr('aria-haspopup', 'true')
- .attr('aria-expanded', 'false');
-
- if (field.cssClass) {
- $dropdownButton.addClass(field.cssClass);
- }
-
- var $dropdownItemsContainer = $('').addClass('dropdown-menu');
-
- for (var i = 0; i < field.items.length; i++) {
- var fieldItem = field.items[i];
-
- if (fieldItem.visible && !fieldItem.visible({ record: record })) {
- continue;
- }
-
- var $dropdownItem = _createDropdownItem(record, fieldItem);
-
- if (fieldItem.enabled && !fieldItem.enabled({ record: record })) {
- $dropdownItem.addClass('disabled');
- }
-
- $dropdownItem.appendTo($dropdownItemsContainer);
- }
-
- if ($dropdownItemsContainer.find('li').length > 0) {
- $dropdownItemsContainer.appendTo($container);
- $dropdownButton.appendTo($container);
- }
-
- if ($dropdownItemsContainer.children().length === 0) {
- return "";
- }
-
- return $container;
- };
-
- var _createSingleButton = function (record, field) {
- $(field.element).data(record);
-
- if (field.visible === undefined) {
- return field.element;
- }
-
- var isVisibilityFunction = typeof field.visible === "function";
- if (isVisibilityFunction) {
- if (field.visible()) {
- return field.element;
- }
- } else {
- if (field.visible) {
- return field.element;
- }
- }
-
- return "";
- };
-
- var _createRowAction = function (record, field, tableInstance) {
- if (field.items && field.items.length > 1) {
- return _createButtonDropdown(record, field, tableInstance);
- } else if (field.element) {
- var $singleActionButton = _createSingleButton(record, field);
- if ($singleActionButton != "") {
- return $singleActionButton.clone(true);
- }
- }
-
- return "";
- }
-
- var hideColumnWithoutRedraw = function (tableInstance, colIndex) {
- tableInstance.fnSetColumnVis(colIndex, false, false);
- }
-
- var hideEmptyColumn = function(cellContent, tableInstance, colIndex) {
- if (cellContent == "") {
- hideColumnWithoutRedraw(tableInstance, colIndex);
- }
- };
-
- var renderRowActions = function (tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull) {
- var columns;
- if (tableInstance.aoColumns) {
- columns = tableInstance.aoColumns;
- } else {
- columns = tableInstance.fnSettings().aoColumns;
- }
-
- if (!columns) {
- return;
- }
-
- var cells = $(nRow).children("td");
-
- for (var colIndex = 0; colIndex < columns.length; colIndex++) {
- var column = columns[colIndex];
- if (column.rowAction) {
- var $actionContainer = _createRowAction(aData, column.rowAction, tableInstance);
- hideEmptyColumn($actionContainer, tableInstance, colIndex);
-
- var $actionButton = $(cells[colIndex]).find(".action-button");
- if ($actionButton.length === 0) {
- $(cells[colIndex]).append($actionContainer);
- }
- }
- }
- };
-
- var _existingApiRenderRowActionsFunction = $.fn.dataTableExt.oApi.renderRowActions;
- $.fn.dataTableExt.oApi.renderRowActions = function (tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull) {
- if (_existingApiRenderRowActionsFunction) {
- _existingApiRenderRowActionsFunction(tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull);
- }
-
- renderRowActions(tableInstance, nRow, aData, iDisplayIndex, iDisplayIndexFull);
- };
-
- if (!$.fn.dataTable) {
- return;
- }
-
- var _existingDefaultFnRowCallback = $.fn.dataTable.defaults.fnRowCallback;
- $.extend(true, $.fn.dataTable.defaults, {
- fnRowCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
- if (_existingDefaultFnRowCallback) {
- _existingDefaultFnRowCallback(this, nRow, aData, iDisplayIndex, iDisplayIndexFull);
- }
-
- renderRowActions(this, nRow, aData, iDisplayIndex, iDisplayIndexFull);
- }
- });
-
-})(jQuery);
\ No newline at end of file
diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/datatables_helper.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/datatables_helper.js
deleted file mode 100644
index a9f6372bf6..0000000000
--- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/helpers/datatables_helper.js
+++ /dev/null
@@ -1,77 +0,0 @@
-var abp = abp;
-(function () {
-
- var datatables = abp.utils.createNamespace(abp, 'libs.datatables');
-
- datatables.createAjax = function(serverMethod, inputAction) {
- return function (requestData, callback, settings) {
- var input = inputAction ? inputAction() : {};
-
- //Paging
- if (settings.oInit.paging) {
- input.maxResultCount = requestData.length;
- input.skipCount = requestData.start;
- }
-
- //Sorting
- if (requestData.order && requestData.order.length > 0) {
- var orderingField = requestData.order[0];
- if (requestData.columns[orderingField.column].data) {
- input.sorting = requestData.columns[orderingField.column].data + " " + orderingField.dir;
- }
- }
-
- //Text filter
- if (requestData.search && requestData.search.value !== "") {
- input.filter = requestData.search.value;
- }
-
- if (callback) {
- serverMethod(input).then(function (result) {
- callback({
- recordsTotal: result.totalCount,
- recordsFiltered: result.totalCount,
- data: result.items
- });
- });
- }
- }
- }
-
- //TODO: Implement like we did before!
- datatables.createActionColumn = function (actions) {
- return {
- targets: 0,
- data: null,
- orderable: false,
- autoWidth: false,
- defaultContent: '',
- render: function (list, type, record, meta) {
- var htmlContent;
-
- if (actions && actions.length) {
- var actionLinks = '';
- for (var i = 0; i < actions.length; ++i) {
- var action = actions[i];
- actionLinks += '' + action.text + '';
- }
-
- htmlContent = '' +
- '' +
- '' +
- '
';
- } else {
- htmlContent = '-'; //TODO: ...?
- }
-
- return htmlContent;
- }
- }
- };
-
-})();
-