@wavemaker/app-ng-runtime 11.4.0-next.25501 → 11.4.0-next.25701
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.
- app-ng-runtime/build-task/basic/tree/tree.build.d.ts +1 -2
- app-ng-runtime/build-task/bundles/index.umd.js +9 -11
- app-ng-runtime/build-task/bundles/index.umd.js.map +1 -1
- app-ng-runtime/build-task/esm2015/basic/tree/tree.build.js +3 -4
- app-ng-runtime/build-task/esm2015/data/form/form-field/form-field.build.js +3 -3
- app-ng-runtime/build-task/esm2015/navigation/popover/popover.build.js +3 -3
- app-ng-runtime/build-task/fesm2015/index.js +9 -11
- app-ng-runtime/build-task/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/base/bundles/index.umd.js +29 -4
- app-ng-runtime/components/base/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/base/esm2015/public_api.js +2 -2
- app-ng-runtime/components/base/esm2015/utils/widget-utils.js +22 -4
- app-ng-runtime/components/base/esm2015/widgets/common/base/base-field-validations.js +3 -2
- app-ng-runtime/components/base/esm2015/widgets/common/dialog/dialog.service.js +7 -1
- app-ng-runtime/components/base/fesm2015/index.js +30 -6
- app-ng-runtime/components/base/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/base/index.metadata.json +1 -1
- app-ng-runtime/components/base/public_api.d.ts +1 -1
- app-ng-runtime/components/base/utils/widget-utils.d.ts +8 -1
- app-ng-runtime/components/basic/rich-text-editor/bundles/index.umd.js +2 -2
- app-ng-runtime/components/basic/rich-text-editor/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/basic/rich-text-editor/esm2015/rich-text-editor.component.js +3 -3
- app-ng-runtime/components/basic/rich-text-editor/fesm2015/index.js +2 -2
- app-ng-runtime/components/basic/rich-text-editor/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/basic/tree/bundles/index.umd.js +280 -256
- app-ng-runtime/components/basic/tree/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/basic/tree/esm2015/public_api.js +2 -2
- app-ng-runtime/components/basic/tree/esm2015/tree.component.js +322 -0
- app-ng-runtime/components/basic/tree/esm2015/tree.module.js +3 -3
- app-ng-runtime/components/basic/tree/fesm2015/index.js +260 -248
- app-ng-runtime/components/basic/tree/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/basic/tree/index.metadata.json +1 -1
- app-ng-runtime/components/basic/tree/public_api.d.ts +1 -1
- app-ng-runtime/components/basic/tree/tree.component.d.ts +34 -0
- app-ng-runtime/components/containers/tabs/bundles/index.umd.js +39 -23
- app-ng-runtime/components/containers/tabs/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/containers/tabs/esm2015/tab-pane/tab-pane.component.js +8 -1
- app-ng-runtime/components/containers/tabs/esm2015/tabs.animator.js +33 -13
- app-ng-runtime/components/containers/tabs/fesm2015/index.js +40 -13
- app-ng-runtime/components/containers/tabs/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/containers/tabs/tabs.animator.d.ts +5 -1
- app-ng-runtime/components/data/form/bundles/index.umd.js +37 -13
- app-ng-runtime/components/data/form/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/form/esm2015/form-field/form-field.directive.js +26 -7
- app-ng-runtime/components/data/form/esm2015/form.component.js +10 -5
- app-ng-runtime/components/data/form/fesm2015/index.js +34 -10
- app-ng-runtime/components/data/form/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/form/index.metadata.json +1 -1
- app-ng-runtime/components/data/list/bundles/index.umd.js +63 -48
- app-ng-runtime/components/data/list/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/list/esm2015/list.component.js +61 -46
- app-ng-runtime/components/data/list/fesm2015/index.js +60 -45
- app-ng-runtime/components/data/list/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/list/index.metadata.json +1 -1
- app-ng-runtime/components/data/list/list.component.d.ts +1 -1
- app-ng-runtime/components/data/pagination/bundles/index.umd.js +22 -5
- app-ng-runtime/components/data/pagination/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/pagination/esm2015/pagination.component.js +23 -6
- app-ng-runtime/components/data/pagination/fesm2015/index.js +22 -5
- app-ng-runtime/components/data/pagination/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/pagination/index.metadata.json +1 -1
- app-ng-runtime/components/data/pagination/pagination.component.d.ts +1 -0
- app-ng-runtime/components/data/table/bundles/index.umd.js +66 -13
- app-ng-runtime/components/data/table/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/table/esm2015/table-filter.directive.js +3 -2
- app-ng-runtime/components/data/table/esm2015/table.component.js +63 -13
- app-ng-runtime/components/data/table/esm2015/table.props.js +3 -1
- app-ng-runtime/components/data/table/fesm2015/index.js +66 -13
- app-ng-runtime/components/data/table/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/table/index.metadata.json +1 -1
- app-ng-runtime/components/data/table/table.component.d.ts +9 -0
- app-ng-runtime/components/dialogs/default/base-dialog.d.ts +1 -0
- app-ng-runtime/components/dialogs/default/bundles/index.umd.js +17 -3
- app-ng-runtime/components/dialogs/default/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/dialogs/default/esm2015/base-dialog.js +18 -5
- app-ng-runtime/components/dialogs/default/fesm2015/index.js +17 -4
- app-ng-runtime/components/dialogs/default/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/dialogs/default/index.metadata.json +1 -1
- app-ng-runtime/components/input/epoch/base-date-time.component.d.ts +5 -0
- app-ng-runtime/components/input/epoch/bundles/index.umd.js +97 -32
- app-ng-runtime/components/input/epoch/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/input/epoch/date-time/date-time-picker.component.d.ts +1 -0
- app-ng-runtime/components/input/epoch/esm2015/base-date-time.component.js +73 -26
- app-ng-runtime/components/input/epoch/esm2015/date/date.component.js +3 -4
- app-ng-runtime/components/input/epoch/esm2015/date-time/date-time-picker.component.js +31 -11
- app-ng-runtime/components/input/epoch/esm2015/date-time/date-time.component.js +2 -2
- app-ng-runtime/components/input/epoch/fesm2015/index.js +105 -39
- app-ng-runtime/components/input/epoch/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/input/epoch/index.metadata.json +1 -1
- app-ng-runtime/components/navigation/menu/bundles/index.umd.js +25 -19
- app-ng-runtime/components/navigation/menu/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/navigation/menu/esm2015/menu-dropdown-item/menu-dropdown-item.component.js +15 -5
- app-ng-runtime/components/navigation/menu/esm2015/menu.component.js +14 -19
- app-ng-runtime/components/navigation/menu/fesm2015/index.js +25 -20
- app-ng-runtime/components/navigation/menu/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/navigation/menu/index.metadata.json +1 -1
- app-ng-runtime/components/navigation/menu/menu-dropdown-item/menu-dropdown-item.component.d.ts +7 -4
- app-ng-runtime/components/navigation/menu/menu.component.d.ts +3 -7
- app-ng-runtime/components/navigation/popover/bundles/index.umd.js +3 -1
- app-ng-runtime/components/navigation/popover/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/navigation/popover/esm2015/popover.component.js +5 -3
- app-ng-runtime/components/navigation/popover/fesm2015/index.js +4 -2
- app-ng-runtime/components/navigation/popover/fesm2015/index.js.map +1 -1
- app-ng-runtime/core/bundles/index.umd.js +7 -1
- app-ng-runtime/core/bundles/index.umd.js.map +1 -1
- app-ng-runtime/core/esm2015/services/pagination.service.js +8 -2
- app-ng-runtime/core/fesm2015/index.js +7 -1
- app-ng-runtime/core/fesm2015/index.js.map +1 -1
- app-ng-runtime/mobile/components/page/default/bundles/index.umd.js +24 -6
- app-ng-runtime/mobile/components/page/default/bundles/index.umd.js.map +1 -1
- app-ng-runtime/mobile/components/page/default/esm2015/page.directive.js +20 -3
- app-ng-runtime/mobile/components/page/default/fesm2015/index.js +19 -2
- app-ng-runtime/mobile/components/page/default/fesm2015/index.js.map +1 -1
- app-ng-runtime/mobile/components/page/default/index.metadata.json +1 -1
- app-ng-runtime/mobile/components/page/default/page.directive.d.ts +4 -1
- app-ng-runtime/mobile/core/bundles/index.umd.js +2 -1
- app-ng-runtime/mobile/core/bundles/index.umd.js.map +1 -1
- app-ng-runtime/mobile/core/esm2015/services/device.service.js +3 -2
- app-ng-runtime/mobile/core/fesm2015/index.js +2 -1
- app-ng-runtime/mobile/core/fesm2015/index.js.map +1 -1
- app-ng-runtime/mobile/runtime-dynamic/bundles/index.umd.js +3 -2
- app-ng-runtime/mobile/runtime-dynamic/bundles/index.umd.js.map +1 -1
- app-ng-runtime/mobile/runtime-dynamic/esm2015/services/live-sync.service.js +4 -3
- app-ng-runtime/mobile/runtime-dynamic/fesm2015/index.js +3 -2
- app-ng-runtime/mobile/runtime-dynamic/fesm2015/index.js.map +1 -1
- app-ng-runtime/package.json +1 -1
- app-ng-runtime/runtime/base/bundles/index.umd.js +1 -0
- app-ng-runtime/runtime/base/bundles/index.umd.js.map +1 -1
- app-ng-runtime/runtime/base/esm2015/services/prefab-manager.service.js +2 -1
- app-ng-runtime/runtime/base/fesm2015/index.js +1 -0
- app-ng-runtime/runtime/base/fesm2015/index.js.map +1 -1
- app-ng-runtime/scripts/datatable/datatable.js +117 -48
- app-ng-runtime/scripts/summernote/dist/summernote-lite.min.js +3 -3
- app-ng-runtime/scripts/tree-keyboard-navigation/keyboard-navigation.js +251 -0
- app-ng-runtime/variables/bundles/index.umd.js +19 -16
- app-ng-runtime/variables/bundles/index.umd.js.map +1 -1
- app-ng-runtime/variables/esm2015/constants/variables.constants.js +3 -9
- app-ng-runtime/variables/esm2015/manager/action/notification-action.manager.js +5 -6
- app-ng-runtime/variables/esm2015/service/variables.service.js +8 -1
- app-ng-runtime/variables/fesm2015/index.js +13 -14
- app-ng-runtime/variables/fesm2015/index.js.map +1 -1
- app-ng-runtime/variables/index.metadata.json +1 -1
- app-ng-runtime/variables/service/variables.service.d.ts +4 -0
- app-ng-runtime/components/basic/tree/esm2015/tree.directive.js +0 -310
- app-ng-runtime/components/basic/tree/tree.directive.d.ts +0 -35
|
@@ -534,14 +534,20 @@ $.widget('wm.datatable', {
|
|
|
534
534
|
|
|
535
535
|
/* Returns the tbody markup. */
|
|
536
536
|
_getGridTemplate: function () {
|
|
537
|
-
|
|
537
|
+
|
|
538
|
+
var self = this, preparedData,$tbody,pageStartIndex = self.getPageStartIndex(),
|
|
538
539
|
startRowIndex = self.options.startRowIndex,
|
|
539
540
|
isScrollorOnDemand = self.options.isNavTypeScrollOrOndemand();
|
|
540
541
|
if(isScrollorOnDemand) {
|
|
541
542
|
$tbody = this.gridElement;
|
|
543
|
+
if(this.renderTableOnViewLess) {
|
|
544
|
+
$tbody = this.gridElement.empty();
|
|
545
|
+
this.hideLoadingIndicator();
|
|
546
|
+
// this.addNavigationControls();
|
|
547
|
+
this.renderTableOnViewLess = false;
|
|
548
|
+
}
|
|
542
549
|
} else {
|
|
543
|
-
|
|
544
|
-
$tbody = tbodyExists > 0 ? this.gridElement.find('tbody:first') : this.gridElement.empty();
|
|
550
|
+
$tbody = this.gridElement.empty();
|
|
545
551
|
}
|
|
546
552
|
|
|
547
553
|
if(isScrollorOnDemand) {
|
|
@@ -977,7 +983,7 @@ $.widget('wm.datatable', {
|
|
|
977
983
|
this._render(true);
|
|
978
984
|
},
|
|
979
985
|
_setGridEditMode: function (val) {
|
|
980
|
-
if (
|
|
986
|
+
if (_.isFunction(this.options.setGridEditMode)) {
|
|
981
987
|
this.options.setGridEditMode(val);
|
|
982
988
|
}
|
|
983
989
|
},
|
|
@@ -1035,7 +1041,7 @@ $.widget('wm.datatable', {
|
|
|
1035
1041
|
$gridBody,
|
|
1036
1042
|
$alwaysNewRow;
|
|
1037
1043
|
|
|
1038
|
-
if (!alwaysNewRow &&
|
|
1044
|
+
if (!alwaysNewRow && _.isFunction(this.options.beforeRowInsert)) {
|
|
1039
1045
|
this.options.beforeRowInsert();
|
|
1040
1046
|
}
|
|
1041
1047
|
|
|
@@ -1102,25 +1108,52 @@ $.widget('wm.datatable', {
|
|
|
1102
1108
|
},
|
|
1103
1109
|
|
|
1104
1110
|
/* Inserts a load more button at the end of the table when the pagination selected is on demand */
|
|
1105
|
-
addLoadMoreBtn : function (onDemandMsg, loadingdatamsg, cb) {
|
|
1111
|
+
addLoadMoreBtn : function (onDemandMsg, loadingdatamsg, cb, infScroll) {
|
|
1106
1112
|
// Show Load more button only if it not the last page
|
|
1107
|
-
|
|
1113
|
+
var $btnEl;
|
|
1114
|
+
if (!this.options.isLastPage || infScroll) {
|
|
1108
1115
|
var self = this;
|
|
1109
1116
|
var $parenEl = $('<div class="on-demand-datagrid"><a class="app-button btn btn-block on-demand-load-btn"></a></div>');
|
|
1110
|
-
|
|
1117
|
+
$btnEl = $parenEl.find('a');
|
|
1111
1118
|
$btnEl.append(onDemandMsg);
|
|
1112
1119
|
// Adding load more button in case of on demand pagination
|
|
1113
1120
|
this.element.find('.app-grid-header-inner').append($parenEl);
|
|
1121
|
+
if(infScroll) {
|
|
1122
|
+
if(this.element.find('.on-demand-load-btn').length) {
|
|
1123
|
+
this.element.find('.on-demand-load-btn').text(this.options.viewlessmessage);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1114
1127
|
// Adding click event to the button
|
|
1115
1128
|
$btnEl.on('click', function (e) {
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1129
|
+
// when the button is clicked, hide the button and show loading indicator
|
|
1130
|
+
var lastPage = (self.options.getCurrentPage() == self.options.getPageCount());
|
|
1131
|
+
if(!lastPage) {
|
|
1119
1132
|
self.showLoadingIndicator(loadingdatamsg, false);
|
|
1133
|
+
}
|
|
1134
|
+
if(!self.options.showviewlessbutton){
|
|
1135
|
+
$btnEl.hide();
|
|
1136
|
+
}
|
|
1137
|
+
if(infScroll) {
|
|
1138
|
+
if(lastPage) {
|
|
1139
|
+
self.element.find('.on-demand-datagrid').remove();
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
// Fix for [WMS-23839] refresh data when clicked on View less button
|
|
1143
|
+
if (lastPage && self.options.showviewlessbutton) {
|
|
1144
|
+
$btnEl.hide();
|
|
1145
|
+
self.renderTableOnViewLess = true;
|
|
1146
|
+
self.renderPaginationOnViewLess = true;
|
|
1147
|
+
self.options.enableNavigation();
|
|
1148
|
+
self._renderGrid();
|
|
1149
|
+
}
|
|
1150
|
+
if (cb && typeof cb === 'function') {
|
|
1120
1151
|
cb(e);
|
|
1121
1152
|
}
|
|
1153
|
+
|
|
1122
1154
|
});
|
|
1123
1155
|
}
|
|
1156
|
+
|
|
1124
1157
|
},
|
|
1125
1158
|
|
|
1126
1159
|
/* Shows loading indicator when clicked on load more button or in case of infinite scroll event is triggered */
|
|
@@ -1153,10 +1186,19 @@ $.widget('wm.datatable', {
|
|
|
1153
1186
|
if (!showLoadBtn && !infScroll) {
|
|
1154
1187
|
// In case of on demand pagination, when the next page is not disabled hide the individual elements
|
|
1155
1188
|
this.element.find('.loading-data-msg').hide();
|
|
1189
|
+
this.element.find('.on-demand-load-btn').text(this.options.ondemandmessage);
|
|
1156
1190
|
this.element.find('.on-demand-load-btn').show();
|
|
1191
|
+
} else if((this.options.getCurrentPage() == this.options.getPageCount()) && this.options.showviewlessbutton) {
|
|
1192
|
+
this.element.find('.on-demand-load-btn').show().text(this.options.viewlessmessage);
|
|
1193
|
+
this.element.find('.loading-data-msg').hide();
|
|
1194
|
+
if(infScroll) {
|
|
1195
|
+
if(!this.element.find('.on-demand-load-btn').length) {
|
|
1196
|
+
this.options.addLoadMoreBtn();
|
|
1197
|
+
}
|
|
1198
|
+
this.element.find('.loading-data-msg').hide();
|
|
1199
|
+
}
|
|
1157
1200
|
} else {
|
|
1158
|
-
|
|
1159
|
-
this.element.find('.on-demand-datagrid').hide();
|
|
1201
|
+
this.element.find('.on-demand-datagrid').hide();
|
|
1160
1202
|
}
|
|
1161
1203
|
},
|
|
1162
1204
|
|
|
@@ -1234,6 +1276,7 @@ $.widget('wm.datatable', {
|
|
|
1234
1276
|
colDef = self.preparedHeaderData[id],
|
|
1235
1277
|
$headerCell = self.gridContainer.find('th[data-col-id="' + id + '"]'),
|
|
1236
1278
|
$tdCell = self.gridElement.find('td.app-datagrid-cell[data-col-id="' + id + '"]'),
|
|
1279
|
+
$footCell=self.tableContainer.find('tfoot tr.app-datagrid-row td.app-datagrid-cell[data-col-id="' + id + '"]'),
|
|
1237
1280
|
$headerCol = $(headerCols[id]),
|
|
1238
1281
|
$bodyCol = $(bodyCols[id]),
|
|
1239
1282
|
definedWidth,
|
|
@@ -1248,11 +1291,13 @@ $.widget('wm.datatable', {
|
|
|
1248
1291
|
$tdCell.hide();
|
|
1249
1292
|
$headerCol.hide();
|
|
1250
1293
|
$bodyCol.hide();
|
|
1294
|
+
$footCell.hide();
|
|
1251
1295
|
} else {
|
|
1252
1296
|
$headerCell.show();
|
|
1253
1297
|
$tdCell.show();
|
|
1254
1298
|
$headerCol.show();
|
|
1255
1299
|
$bodyCol.show();
|
|
1300
|
+
$footCell.show();
|
|
1256
1301
|
}
|
|
1257
1302
|
//If default width is set, reset the width so that correct width is set on reload
|
|
1258
1303
|
if ($headerCol.length && $headerCol[0].style.width === '90px') {
|
|
@@ -1419,6 +1464,9 @@ $.widget('wm.datatable', {
|
|
|
1419
1464
|
this.selectFirstRow(value);
|
|
1420
1465
|
break;
|
|
1421
1466
|
case 'data':
|
|
1467
|
+
if(!this.isResetSortIconsDone) {
|
|
1468
|
+
this.setSortIconDefault();
|
|
1469
|
+
}
|
|
1422
1470
|
this.refreshGridData();
|
|
1423
1471
|
break;
|
|
1424
1472
|
case 'dataStates':
|
|
@@ -1632,10 +1680,10 @@ $.widget('wm.datatable', {
|
|
|
1632
1680
|
isQuickEdit = this.options.editmode === this.CONSTANTS.QUICK_EDIT;
|
|
1633
1681
|
|
|
1634
1682
|
function callRowSelectionEvents() {
|
|
1635
|
-
if (selected &&
|
|
1683
|
+
if (selected && _.isFunction(self.options.onRowSelect)) {
|
|
1636
1684
|
self.options.onRowSelect(data, e);
|
|
1637
1685
|
}
|
|
1638
|
-
if (!selected &&
|
|
1686
|
+
if (!selected && _.isFunction(self.options.onRowDeselect)) {
|
|
1639
1687
|
self.options.onRowDeselect(data, e);
|
|
1640
1688
|
}
|
|
1641
1689
|
}
|
|
@@ -1680,7 +1728,7 @@ $.widget('wm.datatable', {
|
|
|
1680
1728
|
if (!rowData) {
|
|
1681
1729
|
return;
|
|
1682
1730
|
}
|
|
1683
|
-
if (
|
|
1731
|
+
if (_.isFunction(this.options.onRowDblClick)) {
|
|
1684
1732
|
this.options.onRowDblClick(rowData, e);
|
|
1685
1733
|
}
|
|
1686
1734
|
},
|
|
@@ -1722,13 +1770,13 @@ $.widget('wm.datatable', {
|
|
|
1722
1770
|
if (selected) {
|
|
1723
1771
|
$column.addClass(selectedClass);
|
|
1724
1772
|
$th.addClass(selectedClass);
|
|
1725
|
-
if (
|
|
1773
|
+
if (_.isFunction(this.options.onColumnSelect) && e) {
|
|
1726
1774
|
this.options.onColumnSelect(colInfo, e);
|
|
1727
1775
|
}
|
|
1728
1776
|
} else {
|
|
1729
1777
|
$column.removeClass(selectedClass);
|
|
1730
1778
|
$th.removeClass(selectedClass);
|
|
1731
|
-
if (
|
|
1779
|
+
if (_.isFunction(this.options.onColumnDeselect) && e) {
|
|
1732
1780
|
this.options.onColumnDeselect(colInfo, e);
|
|
1733
1781
|
}
|
|
1734
1782
|
}
|
|
@@ -1981,7 +2029,7 @@ $.widget('wm.datatable', {
|
|
|
1981
2029
|
|
|
1982
2030
|
//On success of update or delete
|
|
1983
2031
|
function onSaveSuccess(skipFocus, error) {
|
|
1984
|
-
if (
|
|
2032
|
+
if (_.isFunction(options.success)) {
|
|
1985
2033
|
options.success(skipFocus, error);
|
|
1986
2034
|
}
|
|
1987
2035
|
if (!advancedEdit || self.options.actionsEnabled.edit) {
|
|
@@ -2012,7 +2060,7 @@ $.widget('wm.datatable', {
|
|
|
2012
2060
|
return;
|
|
2013
2061
|
}
|
|
2014
2062
|
$row.addClass('row-editing');
|
|
2015
|
-
if (
|
|
2063
|
+
if (_.isFunction(this.options.beforeRowUpdate)) {
|
|
2016
2064
|
this.options.beforeRowUpdate(rowData, e);
|
|
2017
2065
|
}
|
|
2018
2066
|
|
|
@@ -2025,7 +2073,7 @@ $.widget('wm.datatable', {
|
|
|
2025
2073
|
self.toggleNewRowActions(true);
|
|
2026
2074
|
}
|
|
2027
2075
|
//Event for on before form render. User can update row data here.
|
|
2028
|
-
if (
|
|
2076
|
+
if (_.isFunction(this.options.onBeforeFormRender)) {
|
|
2029
2077
|
isValid = this.options.onBeforeFormRender(rowData, e, options.operation || action);
|
|
2030
2078
|
if (isValid === false) {
|
|
2031
2079
|
return;
|
|
@@ -2048,7 +2096,7 @@ $.widget('wm.datatable', {
|
|
|
2048
2096
|
});
|
|
2049
2097
|
}
|
|
2050
2098
|
//Event for on before form render. User can access form widgets here.
|
|
2051
|
-
if (
|
|
2099
|
+
if (_.isFunction(this.options.onFormRender)) {
|
|
2052
2100
|
this.options.onFormRender($row, e, options.operation || action, $row.hasClass('always-new-row'));
|
|
2053
2101
|
}
|
|
2054
2102
|
} else {
|
|
@@ -2112,7 +2160,7 @@ $.widget('wm.datatable', {
|
|
|
2112
2160
|
}
|
|
2113
2161
|
self.options.setTouched($invalidTd.find('[formcontrolname]').attr('formcontrolname'));
|
|
2114
2162
|
});
|
|
2115
|
-
if (
|
|
2163
|
+
if (_.isFunction(options.success)) {
|
|
2116
2164
|
options.success(false, true);
|
|
2117
2165
|
}
|
|
2118
2166
|
return;
|
|
@@ -2120,14 +2168,14 @@ $.widget('wm.datatable', {
|
|
|
2120
2168
|
|
|
2121
2169
|
if (isNewRow && advancedEdit && _.isEmpty(rowData)) {
|
|
2122
2170
|
self.removeNewRow($row);
|
|
2123
|
-
if (
|
|
2171
|
+
if (_.isFunction(options.success)) {
|
|
2124
2172
|
options.success(false, undefined, true);
|
|
2125
2173
|
}
|
|
2126
2174
|
return;
|
|
2127
2175
|
}
|
|
2128
2176
|
|
|
2129
2177
|
if (isNewRow) {
|
|
2130
|
-
if (
|
|
2178
|
+
if (_.isFunction(this.options.onBeforeRowInsert)) {
|
|
2131
2179
|
isValid = this.options.onBeforeRowInsert(rowData, e, editOptions);
|
|
2132
2180
|
if (isValid === false) {
|
|
2133
2181
|
return;
|
|
@@ -2144,7 +2192,7 @@ $.widget('wm.datatable', {
|
|
|
2144
2192
|
self.removeNewRow($row);
|
|
2145
2193
|
}
|
|
2146
2194
|
} else {
|
|
2147
|
-
if (
|
|
2195
|
+
if (_.isFunction(this.options.onBeforeRowUpdate)) {
|
|
2148
2196
|
isValid = this.options.onBeforeRowUpdate(rowData, e, editOptions);
|
|
2149
2197
|
if (isValid === false) {
|
|
2150
2198
|
return;
|
|
@@ -2157,7 +2205,7 @@ $.widget('wm.datatable', {
|
|
|
2157
2205
|
if (!options.noMsg) {
|
|
2158
2206
|
this.options.noChangesDetected();
|
|
2159
2207
|
}
|
|
2160
|
-
if (
|
|
2208
|
+
if (_.isFunction(options.success)) {
|
|
2161
2209
|
options.success(false);
|
|
2162
2210
|
}
|
|
2163
2211
|
}
|
|
@@ -2267,7 +2315,7 @@ $.widget('wm.datatable', {
|
|
|
2267
2315
|
this.options.setActionRowIndex(rowId);
|
|
2268
2316
|
this.options.setLastActionPerformed(this.options.ACTIONS.DELETE);
|
|
2269
2317
|
|
|
2270
|
-
if (
|
|
2318
|
+
if (_.isFunction(this.options.beforeRowDelete)) {
|
|
2271
2319
|
this.options.beforeRowDelete(rowData, e);
|
|
2272
2320
|
}
|
|
2273
2321
|
if (isNewRow) {
|
|
@@ -2283,13 +2331,13 @@ $.widget('wm.datatable', {
|
|
|
2283
2331
|
return;
|
|
2284
2332
|
}
|
|
2285
2333
|
/* calling onbeforerowDelete callback function.*/
|
|
2286
|
-
if(
|
|
2334
|
+
if(_.isFunction(this.options.onBeforeRowDelete)) {
|
|
2287
2335
|
isValid = this.options.onBeforeRowDelete(rowData, e, options);
|
|
2288
2336
|
if (isValid === false) {
|
|
2289
2337
|
return;
|
|
2290
2338
|
}
|
|
2291
2339
|
}
|
|
2292
|
-
if (
|
|
2340
|
+
if (_.isFunction(this.options.onRowDelete)) {
|
|
2293
2341
|
className = this.options.cssClassNames.deleteRow;
|
|
2294
2342
|
isActiveRow = $row.attr('class').indexOf('active') !== -1;
|
|
2295
2343
|
if (isActiveRow) {
|
|
@@ -2372,6 +2420,7 @@ $.widget('wm.datatable', {
|
|
|
2372
2420
|
},
|
|
2373
2421
|
//Method to remove sort icons from the column header cells
|
|
2374
2422
|
resetSortIcons: function ($el) {
|
|
2423
|
+
this.isResetSortIconsDone = true;
|
|
2375
2424
|
var $sortContainer;
|
|
2376
2425
|
//If sort icon is not passed, find out the sort icon from the active class
|
|
2377
2426
|
if (!$el && this.gridHeaderElement) {
|
|
@@ -2381,9 +2430,25 @@ $.widget('wm.datatable', {
|
|
|
2381
2430
|
}
|
|
2382
2431
|
$el.removeClass('desc asc').removeClass(this.options.cssClassNames.descIcon).removeClass(this.options.cssClassNames.ascIcon);
|
|
2383
2432
|
},
|
|
2433
|
+
setSortIconDefault: function() {
|
|
2434
|
+
const sortInfo = this.options.sortInfo,
|
|
2435
|
+
$e = this.tableContainer,
|
|
2436
|
+
$th = $e.find("[data-col-field='" + sortInfo.field + "']"),
|
|
2437
|
+
$sortContainer = $th.find('.sort-buttons-container'),
|
|
2438
|
+
$sortIcon = $sortContainer.find('i.sort-icon'),
|
|
2439
|
+
direction = sortInfo.direction;
|
|
2440
|
+
if (direction === 'asc') {
|
|
2441
|
+
$sortIcon.addClass(direction + ' ' + this.options.cssClassNames.ascIcon);
|
|
2442
|
+
$sortContainer.addClass('active');
|
|
2443
|
+
} else if (direction === 'desc'){
|
|
2444
|
+
$sortIcon.addClass(direction + ' ' + this.options.cssClassNames.descIcon);
|
|
2445
|
+
$sortContainer.addClass('active');
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
},
|
|
2384
2449
|
/* Handles table sorting. */
|
|
2385
2450
|
sortHandler: function (e) {
|
|
2386
|
-
|
|
2451
|
+
e.stopImmediatePropagation();
|
|
2387
2452
|
// If header span is clicked and column selection is enabled, call header click
|
|
2388
2453
|
if ($(e.target).hasClass('header-data') && this.options.enableColumnSelection) {
|
|
2389
2454
|
this.headerClickHandler(e);
|
|
@@ -2393,7 +2458,7 @@ $.widget('wm.datatable', {
|
|
|
2393
2458
|
id = $th.attr('data-col-id'),
|
|
2394
2459
|
$sortContainer = $th.find('.sort-buttons-container'),
|
|
2395
2460
|
$sortIcon = $sortContainer.find('i.sort-icon'),
|
|
2396
|
-
direction = $sortIcon.hasClass('asc') ? 'desc' :
|
|
2461
|
+
direction = $sortIcon.hasClass('asc') ? 'desc' : 'asc',
|
|
2397
2462
|
sortInfo = this.options.sortInfo,
|
|
2398
2463
|
$previousSortMarker = this.gridHeaderElement.find('.sort-buttons-container.active'),
|
|
2399
2464
|
field = $th.attr('data-col-field'),
|
|
@@ -2917,10 +2982,10 @@ $.widget('wm.datatable', {
|
|
|
2917
2982
|
// If we enable multiselect and check header checkbox then updating selecteditem in datatable.
|
|
2918
2983
|
self.options.assignSelectedItems(rowData, e);
|
|
2919
2984
|
self.toggleRowSelection($row, checked, e, true);
|
|
2920
|
-
if (checked &&
|
|
2985
|
+
if (checked && _.isFunction(self.options.onRowSelect)) {
|
|
2921
2986
|
self.options.onRowSelect(rowData, e);
|
|
2922
2987
|
}
|
|
2923
|
-
if (!checked &&
|
|
2988
|
+
if (!checked && _.isFunction(self.options.onRowDeselect)) {
|
|
2924
2989
|
self.options.onRowDeselect(rowData, e);
|
|
2925
2990
|
}
|
|
2926
2991
|
});
|
|
@@ -2955,7 +3020,7 @@ $.widget('wm.datatable', {
|
|
|
2955
3020
|
/**Add event handler, to the select all checkbox on the header**/
|
|
2956
3021
|
$header.on('click', '.app-datagrid-header-cell input:checkbox', toggleSelectAll);
|
|
2957
3022
|
|
|
2958
|
-
if (
|
|
3023
|
+
if (_.isFunction(this.options.onHeaderClick)) {
|
|
2959
3024
|
this.gridHeaderElement.find('th.app-datagrid-header-cell').on('click', this.headerClickHandler.bind(this));
|
|
2960
3025
|
}
|
|
2961
3026
|
|
|
@@ -2996,6 +3061,9 @@ $.widget('wm.datatable', {
|
|
|
2996
3061
|
}
|
|
2997
3062
|
});
|
|
2998
3063
|
}
|
|
3064
|
+
if(!this.isResetSortIconsDone) {
|
|
3065
|
+
this.setSortIconDefault();
|
|
3066
|
+
}
|
|
2999
3067
|
},
|
|
3000
3068
|
addOrRemoveScroll: function () {
|
|
3001
3069
|
var gridContent = this.gridContainer.find('tbody'),
|
|
@@ -3060,6 +3128,7 @@ $.widget('wm.datatable', {
|
|
|
3060
3128
|
// initally append tbody to gridElement
|
|
3061
3129
|
this.gridElement.append($htm);
|
|
3062
3130
|
}
|
|
3131
|
+
|
|
3063
3132
|
} else {
|
|
3064
3133
|
var templates = this._getGridTemplate();
|
|
3065
3134
|
$htm = $(templates);
|
|
@@ -3071,7 +3140,9 @@ $.widget('wm.datatable', {
|
|
|
3071
3140
|
if (this.options.summaryRow) {
|
|
3072
3141
|
var $summaryRowHtm = $(this._getSummaryRowTemplate());
|
|
3073
3142
|
this.tableContainer.find('tfoot').remove();
|
|
3074
|
-
this.
|
|
3143
|
+
if (this.options.data.length){
|
|
3144
|
+
this.tableContainer.append($summaryRowHtm);
|
|
3145
|
+
}
|
|
3075
3146
|
}
|
|
3076
3147
|
// Set proper data status messages after the grid is rendered.
|
|
3077
3148
|
if (!this.options.data.length && this.dataStatus.state === 'nodata') {
|
|
@@ -3082,7 +3153,7 @@ $.widget('wm.datatable', {
|
|
|
3082
3153
|
this.setStatus(this.dataStatus.state, this.dataStatus.message, isCreated);
|
|
3083
3154
|
}
|
|
3084
3155
|
this.gridBody = this.gridElement.find('tbody');
|
|
3085
|
-
this.gridFooter = this.
|
|
3156
|
+
this.gridFooter = this.tableContainer.find('tfoot');
|
|
3086
3157
|
this._findAndReplaceCompiledTemplates();
|
|
3087
3158
|
this.options.clearRowActions();
|
|
3088
3159
|
// attach event handlers
|
|
@@ -3097,7 +3168,7 @@ $.widget('wm.datatable', {
|
|
|
3097
3168
|
if (isCreated) {
|
|
3098
3169
|
this._setColSpan(this.options.headerConfig);
|
|
3099
3170
|
}
|
|
3100
|
-
if (
|
|
3171
|
+
if (_.isFunction(this.options.onDataRender)) {
|
|
3101
3172
|
this.options.onDataRender();
|
|
3102
3173
|
}
|
|
3103
3174
|
if (!isCreated && this.options.selectFirstRow) {
|
|
@@ -3126,7 +3197,7 @@ $.widget('wm.datatable', {
|
|
|
3126
3197
|
'<div class="app-grid-header">' +
|
|
3127
3198
|
'<div class="app-grid-header-inner">' +
|
|
3128
3199
|
'<table tabindex="0" class="' + this.options.cssClassNames.gridDefault + ' ' + this.options.cssClassNames.grid + '">' +
|
|
3129
|
-
'<thead tabindex="0" class="table-header" id="table_header_' + this.tableId + '">' +
|
|
3200
|
+
'<thead tabindex="0" class="table-header thead-sticky" id="table_header_' + this.tableId + '">' +
|
|
3130
3201
|
'</thead><tbody class="app-grid-content app-datagrid-body" id="table_' + this.tableId + '">' +
|
|
3131
3202
|
'</tbody></table>' +
|
|
3132
3203
|
'</div></div></div>',
|
|
@@ -3170,13 +3241,16 @@ $.widget('wm.datatable', {
|
|
|
3170
3241
|
this._toggleSpacingClasses('condensed');
|
|
3171
3242
|
}
|
|
3172
3243
|
this._renderGrid(isCreated);
|
|
3244
|
+
this.addNavigationControls();
|
|
3245
|
+
},
|
|
3246
|
+
addNavigationControls: function() {
|
|
3173
3247
|
/**
|
|
3174
3248
|
* bind on demand / scroll events to the table in case of dynamictable in render fn
|
|
3175
3249
|
* Render is called everytime when there is a change in dataset and the previously binded events are lost
|
|
3176
3250
|
*/
|
|
3177
3251
|
if (this.options.isdynamictable) {
|
|
3178
|
-
|
|
3179
|
-
if (this.options.navigation === 'On-Demand' && !this.element.find('.on-demand-datagrid').length) {
|
|
3252
|
+
this.element.find('.on-demand-datagrid').remove();
|
|
3253
|
+
if (this.options.navigation === 'On-Demand' && (!this.element.find('.on-demand-datagrid').length)) {
|
|
3180
3254
|
this.options.addLoadMoreBtn();
|
|
3181
3255
|
} else if (this.options.navigation === 'Scroll') {
|
|
3182
3256
|
this.options.bindScrollEvt();
|
|
@@ -3196,7 +3270,8 @@ $.widget('wm.datatable', {
|
|
|
3196
3270
|
if (state === 'ready') {
|
|
3197
3271
|
this.dataStatusContainer.hide();
|
|
3198
3272
|
} else {
|
|
3199
|
-
|
|
3273
|
+
// [WMS-23839] always show load more btn if show view less btn is true
|
|
3274
|
+
if (this.options.isNavTypeScrollOrOndemand() && (state === 'nodata' || ((this.options.getCurrentPage() == this.options.getPageCount()) && !this.options.showviewlessbutton))) {
|
|
3200
3275
|
this.element.find('.on-demand-datagrid a').hide();
|
|
3201
3276
|
}
|
|
3202
3277
|
this.dataStatusContainer.show();
|
|
@@ -3283,12 +3358,6 @@ $.widget('wm.datatable', {
|
|
|
3283
3358
|
}
|
|
3284
3359
|
this.options[key] = value;
|
|
3285
3360
|
if (key === 'height') {
|
|
3286
|
-
if(this.options.showHeader) {
|
|
3287
|
-
// this._setStyles(this.gridHeaderElement, 'z-index: 1; position: sticky; top:0px;');
|
|
3288
|
-
$thead = this.gridHeaderElement;
|
|
3289
|
-
$thead.addClass("thead-sticky");
|
|
3290
|
-
}
|
|
3291
|
-
|
|
3292
3361
|
// if(this.dataStatus.state != 'loading') {
|
|
3293
3362
|
var elements = this.gridHeaderElement.find('th');
|
|
3294
3363
|
// this._setStyles(this.tableContainer, 'border-collapse: separate;');
|