@wavemaker/app-runtime-wm-build 11.4.0-next.1417031 → 11.4.0-next.1417033

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/app-runtime-wm-build",
3
- "version": "11.4.0-next.1417031",
3
+ "version": "11.4.0-next.1417033",
4
4
  "description": "All modules required for a wavemaker application.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -166185,12 +166185,11 @@ $.widget("wm.datatable", {
166185
166185
  }
166186
166186
  },
166187
166187
  _getGridTemplate: function() {
166188
- var self = this, preparedData, $tbody, tbodyExists, pageStartIndex = self.getPageStartIndex(), startRowIndex = self.options.startRowIndex, isScrollorOnDemand = self.options.isNavTypeScrollOrOndemand();
166188
+ var self = this, preparedData, $tbody, pageStartIndex = self.getPageStartIndex(), startRowIndex = self.options.startRowIndex, isScrollorOnDemand = self.options.isNavTypeScrollOrOndemand();
166189
166189
  if (isScrollorOnDemand) {
166190
166190
  $tbody = this.gridElement;
166191
166191
  } else {
166192
- tbodyExists = this.gridElement.find("tbody").length;
166193
- $tbody = tbodyExists > 0 ? this.gridElement.find("tbody:first") : this.gridElement.empty();
166192
+ $tbody = this.gridElement.empty();
166194
166193
  }
166195
166194
  if (isScrollorOnDemand) {
166196
166195
  this._handleCRUDForInfiniteScroll($tbody);
@@ -166908,6 +166907,9 @@ $.widget("wm.datatable", {
166908
166907
  break;
166909
166908
 
166910
166909
  case "data":
166910
+ if (!this.isResetSortIconsDone) {
166911
+ this.setSortIconDefault();
166912
+ }
166911
166913
  this.refreshGridData();
166912
166914
  break;
166913
166915
 
@@ -167666,6 +167668,7 @@ $.widget("wm.datatable", {
167666
167668
  }));
167667
167669
  },
167668
167670
  resetSortIcons: function($el) {
167671
+ this.isResetSortIconsDone = true;
167669
167672
  var $sortContainer;
167670
167673
  if (!$el && this.gridHeaderElement) {
167671
167674
  $sortContainer = this.gridHeaderElement.find(".sort-buttons-container.active");
@@ -167674,12 +167677,22 @@ $.widget("wm.datatable", {
167674
167677
  }
167675
167678
  $el.removeClass("desc asc").removeClass(this.options.cssClassNames.descIcon).removeClass(this.options.cssClassNames.ascIcon);
167676
167679
  },
167680
+ setSortIconDefault: function() {
167681
+ const sortInfo = this.options.sortInfo, $e = this.tableContainer, $th = $e.find("[data-col-field='" + sortInfo.field + "']"), $sortContainer = $th.find(".sort-buttons-container"), $sortIcon = $sortContainer.find("i.sort-icon"), direction = sortInfo.direction;
167682
+ if (direction === "asc") {
167683
+ $sortIcon.addClass(direction + " " + this.options.cssClassNames.ascIcon);
167684
+ $sortContainer.addClass("active");
167685
+ } else if (direction === "desc") {
167686
+ $sortIcon.addClass(direction + " " + this.options.cssClassNames.descIcon);
167687
+ $sortContainer.addClass("active");
167688
+ }
167689
+ },
167677
167690
  sortHandler: function(e) {
167678
167691
  e.stopImmediatePropagation();
167679
167692
  if ($(e.target).hasClass("header-data") && this.options.enableColumnSelection) {
167680
167693
  this.headerClickHandler(e);
167681
167694
  }
167682
- var $e = $(e.target), $th = $e.closest("th.app-datagrid-header-cell"), id = $th.attr("data-col-id"), $sortContainer = $th.find(".sort-buttons-container"), $sortIcon = $sortContainer.find("i.sort-icon"), direction = $sortIcon.hasClass("asc") ? "desc" : $sortIcon.hasClass("desc") ? "" : "asc", sortInfo = this.options.sortInfo, $previousSortMarker = this.gridHeaderElement.find(".sort-buttons-container.active"), field = $th.attr("data-col-field"), $previousSortedColumn, $previousSortIcon, colId, colDef;
167695
+ var $e = $(e.target), $th = $e.closest("th.app-datagrid-header-cell"), id = $th.attr("data-col-id"), $sortContainer = $th.find(".sort-buttons-container"), $sortIcon = $sortContainer.find("i.sort-icon"), direction = $sortIcon.hasClass("asc") ? "desc" : "asc", sortInfo = this.options.sortInfo, $previousSortMarker = this.gridHeaderElement.find(".sort-buttons-container.active"), field = $th.attr("data-col-field"), $previousSortedColumn, $previousSortIcon, colId, colDef;
167683
167696
  this.resetSortIcons($sortIcon);
167684
167697
  $sortIcon.addClass(direction);
167685
167698
  if (direction === "asc") {
@@ -168150,6 +168163,9 @@ $.widget("wm.datatable", {
168150
168163
  }
168151
168164
  });
168152
168165
  }
168166
+ if (!this.isResetSortIconsDone) {
168167
+ this.setSortIconDefault();
168168
+ }
168153
168169
  },
168154
168170
  addOrRemoveScroll: function() {
168155
168171
  var gridContent = this.gridContainer.find("tbody"), gridHeader = this.gridContainer.find(".table-header");