showSortModal = function showSortModal(that) {
	  var _selector = that.sortModalSelector;

	  var _id = "#".concat(_selector);

	  var o = that.options;

	  if (!$(_id).hasClass('modal')) {
	    var sModal = Utils.sprintf(that.constants.html.multipleSortModal, _selector, _selector, _selector, that.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, that.constants.icons.plus), that.options.formatAddLevel(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, that.constants.icons.minus), that.options.formatDeleteLevel(), that.options.formatColumn(), that.options.formatOrder(), that.options.formatCancel(), that.options.formatSort());
	    $('body').append($(sModal));
	    that.$sortModal = $(_id);
	    var $rows = that.$sortModal.find('tbody > tr');
	    that.$sortModal.off('click', '#add').on('click', '#add', function () {
	      var total = that.$sortModal.find('.multi-sort-name:first option').length;
	      var current = that.$sortModal.find('tbody tr').length;

	      if (current < total) {
	        current++;
	        that.addLevel();
	        that.setButtonStates();
	      }
	    });
	    that.$sortModal.off('click', '#delete').on('click', '#delete', function () {
	      var total = that.$sortModal.find('.multi-sort-name:first option').length;
	      var current = that.$sortModal.find('tbody tr').length;

	      if (current > 1 && current <= total) {
	        current--;
	        that.$sortModal.find('tbody tr:last').remove();
	        that.setButtonStates();
	      }
	    });
	    that.$sortModal.off('click', '.multi-sort-order-button').on('click', '.multi-sort-order-button', function () {
	      var $rows = that.$sortModal.find('tbody > tr');
	      var $alert = that.$sortModal.find('div.alert');
	      var fields = [];
	      var results = [];
	      that.options.sortPriority = $.map($rows, function (row) {
	        var $row = $(row);
	        var name = $row.find('.multi-sort-name').val();
	        var order = $row.find('.multi-sort-order').val();
	        fields.push(name);
	        return {
	          sortName: name,
	          sortOrder: order
	        };
	      });
	      var sorted_fields = fields.sort();

	      for (var i = 0; i < fields.length - 1; i++) {
	        if (sorted_fields[i + 1] === sorted_fields[i]) {
	          results.push(sorted_fields[i]);
	        }
	      }

	      if (results.length > 0) {
	        if ($alert.length === 0) {
	          $alert = "<div class=\"alert alert-danger\" role=\"alert\"><strong>".concat(that.options.formatDuplicateAlertTitle(), "</strong> ").concat(that.options.formatDuplicateAlertDescription(), "</div>");
	          $($alert).insertBefore(that.$sortModal.find('.bars'));
	        }
	      } else {
	        if ($alert.length === 1) {
	          $($alert).remove();
	        }

	        if ($.inArray($.fn.bootstrapTable.theme, ['bootstrap3', 'bootstrap4']) !== -1) {
	          that.$sortModal.modal('hide');
	        }

	        that.options.sortName = '';

	        if (that.options.sidePagination === 'server') {
	          var t = that.options.queryParams;

	          that.options.queryParams = function (params) {
	            params.multiSort = that.options.sortPriority;
	            return $.fn.bootstrapTable.utils.calculateObjectValue(that.options, t, [params]);
	          };

	          isSingleSort = false;
	          that.initServer(that.options.silentSort);
	          return;
	        }

	        that.onMultipleSort();
	      }
	    });

	    if (that.options.sortPriority === null || that.options.sortPriority.length === 0) {
	      if (that.options.sortName) {
	        that.options.sortPriority = [{
	          sortName: that.options.sortName,
	          sortOrder: that.options.sortOrder
	        }];
	      }
	    }

	    if (that.options.sortPriority !== null && that.options.sortPriority.length > 0) {
	      if ($rows.length < that.options.sortPriority.length && _typeof(that.options.sortPriority) === 'object') {
	        for (var i = 0; i < that.options.sortPriority.length; i++) {
	          that.addLevel(i, that.options.sortPriority[i]);
	        }
	      }
	    } else {
	      that.addLevel(0);
	    }

	    that.setButtonStates();
	  }
	}
@author Nadim Basalamah <dimbslmh@gmail.com>
@version: v1.1.0
https://github.com/dimbslmh/bootstrap-table/tree/master/src/extensions/multiple-sort/bootstrap-table-multiple-sort.js
Modification: ErwannNevou <https://github.com/ErwannNevou>