@universis/ngx-tables 0.8.4 → 0.8.5
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.
- package/bundles/universis-ngx-tables.umd.js +143 -104
- package/bundles/universis-ngx-tables.umd.js.map +1 -1
- package/bundles/universis-ngx-tables.umd.min.js +1 -1
- package/bundles/universis-ngx-tables.umd.min.js.map +1 -1
- package/esm2015/lib/components/advanced-table/advanced-table.component.js +119 -95
- package/esm2015/lib/components/advanced-table/advanced-table.formatters.js +5 -3
- package/esm2015/lib/components/advanced-table/advanced-table.interfaces.js +1 -1
- package/esm2015/lib/components/column-selector/column-selector.component.js +26 -14
- package/esm2015/lib/components/column-selector/column-selector.service.js +1 -1
- package/esm2015/lib/directives/advance-table-state.directive.js +2 -1
- package/esm5/lib/components/advanced-table/advanced-table.component.js +119 -95
- package/esm5/lib/components/advanced-table/advanced-table.formatters.js +5 -3
- package/esm5/lib/components/advanced-table/advanced-table.interfaces.js +1 -1
- package/esm5/lib/components/column-selector/column-selector.component.js +24 -11
- package/esm5/lib/components/column-selector/column-selector.service.js +1 -1
- package/esm5/lib/directives/advance-table-state.directive.js +1 -1
- package/fesm2015/universis-ngx-tables.js +147 -107
- package/fesm2015/universis-ngx-tables.js.map +1 -1
- package/fesm5/universis-ngx-tables.js +144 -105
- package/fesm5/universis-ngx-tables.js.map +1 -1
- package/lib/components/advanced-table/advanced-table.interfaces.d.ts +1 -0
- package/lib/components/column-selector/column-selector.component.d.ts +4 -5
- package/package.json +1 -1
- package/universis-ngx-tables.metadata.json +1 -1
|
@@ -367,9 +367,11 @@
|
|
|
367
367
|
}
|
|
368
368
|
if (x.formatOptions && x.formatOptions.commands) {
|
|
369
369
|
var urlTree = _this.createUrlTree(row, x.formatOptions);
|
|
370
|
-
return "<a data-name='" + x.name + "' class=\"dropdown-item
|
|
370
|
+
return "<a data-name='" + x.name + "' class=\"dropdown-item" + (typeof x.className === 'string' && x.className.length
|
|
371
|
+
? " " + x.className.trim() : '') + "\" href=\"#" + urlTree.toString() + "\">\n " + _this.injector.get(core.TranslateService).instant(x.title) + "\n </a>";
|
|
371
372
|
}
|
|
372
|
-
return "<a data-name='" + x.name + "' class=\"dropdown-item
|
|
373
|
+
return "<a data-name='" + x.name + "' class=\"dropdown-item" + (typeof x.className === 'string' && x.className.length
|
|
374
|
+
? " " + x.className.trim() : '') + "\" href=\"" + AdvancedColumnFormatter.template(x.href)(row) + "\">\n " + _this.injector.get(core.TranslateService).instant(x.title) + "\n </a>";
|
|
373
375
|
})
|
|
374
376
|
.join('') + "\n </div>\n </div>";
|
|
375
377
|
}
|
|
@@ -704,19 +706,32 @@
|
|
|
704
706
|
|
|
705
707
|
var ColumnSelectorComponent = /** @class */ (function (_super) {
|
|
706
708
|
__extends(ColumnSelectorComponent, _super);
|
|
707
|
-
function ColumnSelectorComponent(router, activatedRoute, _modalRef,
|
|
709
|
+
function ColumnSelectorComponent(router, activatedRoute, _modalRef, _changeDetector) {
|
|
708
710
|
var _this = _super.call(this, router, activatedRoute) || this;
|
|
709
711
|
_this._modalRef = _modalRef;
|
|
710
|
-
_this.
|
|
711
|
-
_this._translateService = _translateService;
|
|
712
|
+
_this._changeDetector = _changeDetector;
|
|
712
713
|
_this.dismiss = new i0.EventEmitter();
|
|
713
714
|
_this.availableColumnsControl = new forms.FormControl();
|
|
714
715
|
_this.selectedColumnsControl = new forms.FormControl();
|
|
716
|
+
_this.changing = false;
|
|
715
717
|
return _this;
|
|
716
718
|
}
|
|
717
719
|
ColumnSelectorComponent.prototype.ok = function () {
|
|
718
|
-
this
|
|
719
|
-
this.
|
|
720
|
+
var _this = this;
|
|
721
|
+
this._changeDetector.detectChanges();
|
|
722
|
+
setTimeout(function () {
|
|
723
|
+
_this.changing = true;
|
|
724
|
+
_this._modalRef.hide();
|
|
725
|
+
}, 0);
|
|
726
|
+
try {
|
|
727
|
+
this.applyChanges();
|
|
728
|
+
}
|
|
729
|
+
catch (err) {
|
|
730
|
+
throw err;
|
|
731
|
+
}
|
|
732
|
+
finally {
|
|
733
|
+
this.changing = false;
|
|
734
|
+
}
|
|
720
735
|
this.dismiss.emit('ok');
|
|
721
736
|
return Promise.resolve('ok');
|
|
722
737
|
};
|
|
@@ -957,8 +972,9 @@
|
|
|
957
972
|
};
|
|
958
973
|
ColumnSelectorComponent.decorators = [
|
|
959
974
|
{ type: i0.Component, args: [{
|
|
975
|
+
// tslint:disable-next-line:component-selector
|
|
960
976
|
selector: 'app-column-selector',
|
|
961
|
-
template: "<div>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">{{'Tables.SelectColumns' | translate}}</h5>\n <button (click)=\"cancel()\"\n type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Cancel\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body pt-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <p [translate]=\"'Tables.SelectColumnHelp'\"></p>\n <p [translate]=\"'Tables.MoveColumnHelp'\"></p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-4\">\n <select [formControl]=\"availableColumnsControl\" size=\"10\" class=\"form-select form-control\" multiple aria-label=\"multiple select example\">\n <ng-container *ngIf=\"columns\">\n <ng-container *ngFor=\"let column of columns | orderBy: ['title']\">\n <option class=\"text-wrap\" [value]=\"column.key\">{{column.title}}</option>\n </ng-container>\n </ng-container>\n </select>\n </div>\n <div class=\"col-4 d-flex justify-content-center align-items-center\">\n <div class=\"col-9\">\n <div>\n <button [disabled]=\"!(availableColumnsControl.value && availableColumnsControl.value.length)\" (click)=\"addColumns()\" type=\"button\" class=\"btn btn-primary btn-block\">\n <i class=\"fas fa-plus mr-2\"></i><span [translate]=\"'Tables.AddColumn'\"></span>\n </button>\n </div>\n <div class=\"mt-3\">\n <button [disabled]=\"!(selectedColumnsControl.value && selectedColumnsControl.value.length)\" (click)=\"removeColumns()\" type=\"button\" class=\"btn btn-secondary btn-block\">\n <i class=\"fas fa-minus mr-2\"></i><span [translate]=\"'Tables.RemoveColumn'\"></span>\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-4\">\n <select [formControl]=\"selectedColumnsControl\" size=\"10\" class=\"form-select form-control\" multiple aria-label=\"multiple select example\">\n <ng-container *ngIf=\"selectedColumns\">\n <ng-container *ngFor=\"let column of selectedColumns\">\n <option class=\"text-wrap\" [value]=\"column.key\">{{column.title}}</option>\n </ng-container>\n </ng-container>\n </select>\n <div class=\"d-flex justify-content-center align-items-center\">\n <div class=\"btn-group mt-4\">\n <button #moveUpButton (click)=\"moveUp()\" type=\"button\" class=\"btn btn-primary\">\n <i class=\"fas fa-chevron-up mr-2\"></i><span [translate]=\"'Tables.MoveUp'\"></span>\n </button>\n <button #moveDownButton (click)=\"moveDown()\" type=\"button\" class=\"btn btn-primary ml-2\">\n <i class=\"fas fa-chevron-down mr-2\"></i><span [translate]=\"'Tables.MoveDown'\"></span>\n </button>\n </div>\n </div>\n </div>\n </div>\n \n </div>\n <div class=\"modal-footer justify-content-end\">\n <button [disabled]=\"okButtonDisabled\" (click)=\"ok()\"\n type=\"button\" class=\"btn btn-primary\">\n {{'OK' | translate}}\n </button>\n <button [disabled]=\"cancelButtonDisabled\"\n (click)=\"cancel()\" type=\"button\" [ngClass]=\"cancelButtonClass\" data-dismiss=\"modal\">\n {{'Cancel' | translate}}\n </button>\n </div>\n </div>\n ",
|
|
977
|
+
template: "<div>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">{{'Tables.SelectColumns' | translate}}</h5>\n <button (click)=\"cancel()\"\n type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Cancel\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body pt-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <p [translate]=\"'Tables.SelectColumnHelp'\"></p>\n <p [translate]=\"'Tables.MoveColumnHelp'\"></p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-4\">\n <select [formControl]=\"availableColumnsControl\" size=\"10\" class=\"form-select form-control\" multiple aria-label=\"multiple select example\">\n <ng-container *ngIf=\"columns\">\n <ng-container *ngFor=\"let column of columns | orderBy: ['title']\">\n <option class=\"text-wrap\" [value]=\"column.key\">{{column.title}}</option>\n </ng-container>\n </ng-container>\n </select>\n </div>\n <div class=\"col-4 d-flex justify-content-center align-items-center\">\n <div class=\"col-9\">\n <div>\n <button [disabled]=\"!(availableColumnsControl.value && availableColumnsControl.value.length)\" (click)=\"addColumns()\" type=\"button\" class=\"btn btn-primary btn-block\">\n <i class=\"fas fa-plus mr-2\"></i><span [translate]=\"'Tables.AddColumn'\"></span>\n </button>\n </div>\n <div class=\"mt-3\">\n <button [disabled]=\"!(selectedColumnsControl.value && selectedColumnsControl.value.length)\" (click)=\"removeColumns()\" type=\"button\" class=\"btn btn-secondary btn-block\">\n <i class=\"fas fa-minus mr-2\"></i><span [translate]=\"'Tables.RemoveColumn'\"></span>\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-4\">\n <select [formControl]=\"selectedColumnsControl\" size=\"10\" class=\"form-select form-control\" multiple aria-label=\"multiple select example\">\n <ng-container *ngIf=\"selectedColumns\">\n <ng-container *ngFor=\"let column of selectedColumns\">\n <option class=\"text-wrap\" [value]=\"column.key\">{{column.title}}</option>\n </ng-container>\n </ng-container>\n </select>\n <div class=\"d-flex justify-content-center align-items-center\">\n <div class=\"btn-group mt-4\">\n <button #moveUpButton (click)=\"moveUp()\" type=\"button\" class=\"btn btn-primary\">\n <i class=\"fas fa-chevron-up mr-2\"></i><span [translate]=\"'Tables.MoveUp'\"></span>\n </button>\n <button #moveDownButton (click)=\"moveDown()\" type=\"button\" class=\"btn btn-primary ml-2\">\n <i class=\"fas fa-chevron-down mr-2\"></i><span [translate]=\"'Tables.MoveDown'\"></span>\n </button>\n </div>\n </div>\n </div>\n </div>\n \n </div>\n <div class=\"modal-footer justify-content-end\">\n\n <button [disabled]=\"okButtonDisabled\" (click)=\"ok()\"\n type=\"button\" class=\"btn btn-primary\">\n <i *ngIf=\"changing\" class=\"fa fa-spinner fa-spin mr-1\"></i>\n {{'OK' | translate}}\n </button>\n <button [disabled]=\"cancelButtonDisabled\"\n (click)=\"cancel()\" type=\"button\" [ngClass]=\"cancelButtonClass\" data-dismiss=\"modal\">\n {{'Cancel' | translate}}\n </button>\n </div>\n </div>\n ",
|
|
962
978
|
encapsulation: i0.ViewEncapsulation.Emulated,
|
|
963
979
|
styles: ["\n .form-select {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 5px;\n }\n .form-select * {\n padding: 5px 5px;\n }\n .btn.disabled, .btn:disabled {\n border-color: transparent !important;\n }\n "]
|
|
964
980
|
}] }
|
|
@@ -969,8 +985,7 @@
|
|
|
969
985
|
{ type: i1$1.Router },
|
|
970
986
|
{ type: i1$1.ActivatedRoute },
|
|
971
987
|
{ type: modal.BsModalRef },
|
|
972
|
-
{ type: i0.ChangeDetectorRef }
|
|
973
|
-
{ type: core.TranslateService }
|
|
988
|
+
{ type: i0.ChangeDetectorRef }
|
|
974
989
|
];
|
|
975
990
|
};
|
|
976
991
|
ColumnSelectorComponent.propDecorators = {
|
|
@@ -2162,113 +2177,141 @@
|
|
|
2162
2177
|
if (order && order.length) {
|
|
2163
2178
|
// get order query expression
|
|
2164
2179
|
var orderByStr = order.map(function (expr) {
|
|
2165
|
-
|
|
2180
|
+
var columnIndex;
|
|
2181
|
+
if (self.columnOrdering === false) {
|
|
2182
|
+
columnIndex = expr.column;
|
|
2183
|
+
}
|
|
2184
|
+
else {
|
|
2185
|
+
// get the current column order (from colReorder)
|
|
2186
|
+
var columnOrder = self.dataTable.colReorder.order();
|
|
2187
|
+
// and match the dataTable index to the config columns index
|
|
2188
|
+
// expr.column should always be valid (e.g. in range), but perform a minor validation
|
|
2189
|
+
if (expr.column >= 0 && expr.column < columnOrder.length) {
|
|
2190
|
+
columnIndex = columnOrder[expr.column];
|
|
2191
|
+
}
|
|
2192
|
+
else {
|
|
2193
|
+
// use the first column as a fallback (won't happen, just for safety)
|
|
2194
|
+
columnIndex = 0;
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
return tableColumns_1[columnIndex].name + ' ' + expr.dir || 'asc';
|
|
2166
2198
|
}).join(',');
|
|
2167
2199
|
// set order
|
|
2168
2200
|
q.setParam('$orderby', orderByStr);
|
|
2169
2201
|
}
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2202
|
+
self.stateLoadCallback(null, function (state) {
|
|
2203
|
+
// configure $select parameter
|
|
2204
|
+
var select = self.config.columns.filter(function (column) {
|
|
2205
|
+
if (column.virtual === true) {
|
|
2206
|
+
return false;
|
|
2207
|
+
}
|
|
2208
|
+
if (column.optional === true) {
|
|
2209
|
+
if (state && state.columns) {
|
|
2210
|
+
var index = tableColumns_1.findIndex(function (tableColumn) { return tableColumn.name === column.name; });
|
|
2211
|
+
if (index >= 0) {
|
|
2212
|
+
return state.columns[index].visible;
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
return false;
|
|
2216
|
+
}
|
|
2217
|
+
return true;
|
|
2218
|
+
}).map(function (column) {
|
|
2219
|
+
if (column.property) {
|
|
2220
|
+
return column.name + ' as ' + column.property;
|
|
2221
|
+
}
|
|
2222
|
+
else {
|
|
2223
|
+
return column.name;
|
|
2224
|
+
}
|
|
2225
|
+
});
|
|
2226
|
+
q.select.apply(q, select);
|
|
2227
|
+
// configure $filter
|
|
2228
|
+
if (queryParams.$filter && queryParams.$filter.length) {
|
|
2229
|
+
// set route filter
|
|
2230
|
+
var qParams = q.getParams();
|
|
2231
|
+
q.setParam('$filter', null);
|
|
2232
|
+
var expressions = [queryParams.$filter];
|
|
2233
|
+
if (qParams.$filter) {
|
|
2234
|
+
expressions.push('(' + qParams.$filter + ')');
|
|
2235
|
+
}
|
|
2236
|
+
q.filter(expressions.join(' and '));
|
|
2174
2237
|
}
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2238
|
+
// check if query parameters contain filter
|
|
2239
|
+
if (queryParams.$expand && queryParams.$expand.length) {
|
|
2240
|
+
// set route $expand
|
|
2241
|
+
q.setParam('$expand', queryParams.$expand);
|
|
2179
2242
|
}
|
|
2180
|
-
else {
|
|
2181
|
-
|
|
2243
|
+
else if (self.config && self.config.defaults && self.config.defaults.expand) {
|
|
2244
|
+
q.setParam('$expand', self.config.defaults.expand);
|
|
2182
2245
|
}
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
// configure $filter
|
|
2186
|
-
if (queryParams.$filter && queryParams.$filter.length) {
|
|
2187
|
-
// set route filter
|
|
2188
|
-
var qParams = q.getParams();
|
|
2189
|
-
q.setParam('$filter', null);
|
|
2190
|
-
var expressions = [queryParams.$filter];
|
|
2191
|
-
if (qParams.$filter) {
|
|
2192
|
-
expressions.push('(' + qParams.$filter + ')');
|
|
2246
|
+
if (!q.getParams()['$orderby'] && self.config && self.config.defaults && self.config.defaults.orderBy) {
|
|
2247
|
+
q.setParam('$orderby', self.config.defaults.orderBy);
|
|
2193
2248
|
}
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
q.setParam('$groupby', self.config.defaults.groupBy);
|
|
2209
|
-
}
|
|
2210
|
-
// append default filter
|
|
2211
|
-
if (self.config && self.config.defaults && self.config.defaults.filter) {
|
|
2212
|
-
return self._advancedFilterValueProvider.asyncBuildFilter(self.config.defaults.filter).then(function (defaultFilterString) {
|
|
2213
|
-
if (defaultFilterString) {
|
|
2214
|
-
var qParams = q.getParams();
|
|
2215
|
-
q.setParam('$filter', null);
|
|
2216
|
-
var expressions = [defaultFilterString];
|
|
2217
|
-
if (qParams.$filter) {
|
|
2218
|
-
expressions.push('(' + qParams.$filter + ')');
|
|
2219
|
-
}
|
|
2220
|
-
q.filter(expressions.join(' and '));
|
|
2221
|
-
}
|
|
2222
|
-
self.lastQueryParams = q.getParams();
|
|
2223
|
-
return q.getList().then(function (items) {
|
|
2224
|
-
var dataSet = {
|
|
2225
|
-
recordsTotal: items.total,
|
|
2226
|
-
recordsFiltered: items.total,
|
|
2227
|
-
data: items.value,
|
|
2228
|
-
};
|
|
2229
|
-
self._lastQueryTotalItems = items.total;
|
|
2230
|
-
if (items.total === 0) {
|
|
2231
|
-
self.resetEmptyTable();
|
|
2249
|
+
if (self.config && self.config.defaults && self.config.defaults.groupBy) {
|
|
2250
|
+
q.setParam('$groupby', self.config.defaults.groupBy);
|
|
2251
|
+
}
|
|
2252
|
+
// append default filter
|
|
2253
|
+
if (self.config && self.config.defaults && self.config.defaults.filter) {
|
|
2254
|
+
return self._advancedFilterValueProvider.asyncBuildFilter(self.config.defaults.filter).then(function (defaultFilterString) {
|
|
2255
|
+
if (defaultFilterString) {
|
|
2256
|
+
var qParams = q.getParams();
|
|
2257
|
+
q.setParam('$filter', null);
|
|
2258
|
+
var expressions = [defaultFilterString];
|
|
2259
|
+
if (qParams.$filter) {
|
|
2260
|
+
expressions.push('(' + qParams.$filter + ')');
|
|
2261
|
+
}
|
|
2262
|
+
q.filter(expressions.join(' and '));
|
|
2232
2263
|
}
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2264
|
+
self.lastQueryParams = q.getParams();
|
|
2265
|
+
return q.getList().then(function (items) {
|
|
2266
|
+
var dataSet = {
|
|
2267
|
+
recordsTotal: items.total,
|
|
2268
|
+
recordsFiltered: items.total,
|
|
2269
|
+
data: items.value,
|
|
2270
|
+
};
|
|
2271
|
+
self._lastQueryTotalItems = items.total;
|
|
2272
|
+
if (items.total === 0) {
|
|
2273
|
+
self.resetEmptyTable();
|
|
2274
|
+
}
|
|
2275
|
+
// emit load event
|
|
2276
|
+
self.load.emit(dataSet);
|
|
2277
|
+
// return data
|
|
2278
|
+
return fnCallback(dataSet);
|
|
2279
|
+
});
|
|
2280
|
+
}).catch(function (err) {
|
|
2281
|
+
// log error to console
|
|
2282
|
+
console.error('TABLES', err);
|
|
2283
|
+
// show error
|
|
2284
|
+
self.toggleError(err);
|
|
2285
|
+
self._lastQueryTotalItems = 0;
|
|
2286
|
+
// by returning empty dataset
|
|
2287
|
+
self.load.emit(EMPTY_DATASET);
|
|
2288
|
+
return fnCallback(EMPTY_DATASET);
|
|
2237
2289
|
});
|
|
2290
|
+
}
|
|
2291
|
+
self.lastQueryParams = q.getParams();
|
|
2292
|
+
q.getList().then(function (items) {
|
|
2293
|
+
var dataSet = {
|
|
2294
|
+
recordsTotal: items.total,
|
|
2295
|
+
recordsFiltered: items.total,
|
|
2296
|
+
data: items.value,
|
|
2297
|
+
};
|
|
2298
|
+
self._lastQueryTotalItems = items.total;
|
|
2299
|
+
if (items.total === 0) {
|
|
2300
|
+
self.resetEmptyTable();
|
|
2301
|
+
}
|
|
2302
|
+
// emit load event
|
|
2303
|
+
self.load.emit(dataSet);
|
|
2304
|
+
// return data
|
|
2305
|
+
return fnCallback(dataSet);
|
|
2238
2306
|
}).catch(function (err) {
|
|
2239
2307
|
// log error to console
|
|
2240
2308
|
console.error('TABLES', err);
|
|
2241
2309
|
// show error
|
|
2242
2310
|
self.toggleError(err);
|
|
2243
|
-
self._lastQueryTotalItems = 0;
|
|
2244
2311
|
// by returning empty dataset
|
|
2245
2312
|
self.load.emit(EMPTY_DATASET);
|
|
2246
2313
|
return fnCallback(EMPTY_DATASET);
|
|
2247
2314
|
});
|
|
2248
|
-
}
|
|
2249
|
-
self.lastQueryParams = q.getParams();
|
|
2250
|
-
q.getList().then(function (items) {
|
|
2251
|
-
var dataSet = {
|
|
2252
|
-
recordsTotal: items.total,
|
|
2253
|
-
recordsFiltered: items.total,
|
|
2254
|
-
data: items.value,
|
|
2255
|
-
};
|
|
2256
|
-
self._lastQueryTotalItems = items.total;
|
|
2257
|
-
if (items.total === 0) {
|
|
2258
|
-
self.resetEmptyTable();
|
|
2259
|
-
}
|
|
2260
|
-
// emit load event
|
|
2261
|
-
self.load.emit(dataSet);
|
|
2262
|
-
// return data
|
|
2263
|
-
return fnCallback(dataSet);
|
|
2264
|
-
}).catch(function (err) {
|
|
2265
|
-
// log error to console
|
|
2266
|
-
console.error('TABLES', err);
|
|
2267
|
-
// show error
|
|
2268
|
-
self.toggleError(err);
|
|
2269
|
-
// by returning empty dataset
|
|
2270
|
-
self.load.emit(EMPTY_DATASET);
|
|
2271
|
-
return fnCallback(EMPTY_DATASET);
|
|
2272
2315
|
});
|
|
2273
2316
|
},
|
|
2274
2317
|
language: Object.assign({}, self.translator.transform('Tables.DataTable'), { emptyTable: ' ' }),
|
|
@@ -2643,12 +2686,8 @@
|
|
|
2643
2686
|
}
|
|
2644
2687
|
// finally apply column order
|
|
2645
2688
|
_this.dataTable.colReorder.order(indexes, true);
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
var tableElement = jQuery(_this.table.nativeElement);
|
|
2649
|
-
var elements = tableElement.find('input.s-row');
|
|
2650
|
-
elements.off('click').on('click', _this.onSelectionChange.bind(_this));
|
|
2651
|
-
}
|
|
2689
|
+
// simply redraw the table
|
|
2690
|
+
_this.dataTable.draw();
|
|
2652
2691
|
}
|
|
2653
2692
|
});
|
|
2654
2693
|
};
|