inviton-powerduck 0.0.80 → 0.0.81
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.
|
@@ -337,7 +337,7 @@ export class DataTableFilterItemCollection extends Array<DataTableFilterItem> {
|
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
export class DataTableConfig {
|
|
340
|
-
static filterMarking =
|
|
340
|
+
static filterMarking = true;
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
@Component
|
|
@@ -854,6 +854,24 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
854
854
|
return selectedRows;
|
|
855
855
|
}
|
|
856
856
|
|
|
857
|
+
unmarkSelection(cb: () => void): void {
|
|
858
|
+
if (DataTableConfig.filterMarking) {
|
|
859
|
+
this.markInstance.unmark({
|
|
860
|
+
done: () => {
|
|
861
|
+
this.enforceBodyRedraw = true;
|
|
862
|
+
this.$nextTick(() => {
|
|
863
|
+
this.enforceBodyRedraw = false;
|
|
864
|
+
this.$nextTick(() => {
|
|
865
|
+
cb();
|
|
866
|
+
});
|
|
867
|
+
});
|
|
868
|
+
},
|
|
869
|
+
});
|
|
870
|
+
} else {
|
|
871
|
+
cb();
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
857
875
|
markSelection(): void {
|
|
858
876
|
var mySelf = this;
|
|
859
877
|
var escapeRegExp = function (string) {
|
|
@@ -889,10 +907,8 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
889
907
|
}
|
|
890
908
|
|
|
891
909
|
if (DataTableConfig.filterMarking) {
|
|
892
|
-
this.
|
|
893
|
-
|
|
894
|
-
mySelf.markInstance.markRegExp(new RegExp("(" + regexBuilder + ")", "i"));
|
|
895
|
-
},
|
|
910
|
+
this.unmarkSelection(() => {
|
|
911
|
+
mySelf.markInstance.markRegExp(new RegExp("(" + regexBuilder + ")", "i"));
|
|
896
912
|
});
|
|
897
913
|
}
|
|
898
914
|
}
|
|
@@ -926,11 +942,13 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
926
942
|
|
|
927
943
|
handleClientsideFilter(markResults?: boolean): boolean {
|
|
928
944
|
if (this.filterMode == DataTableFilterMode.Clientside) {
|
|
929
|
-
this.
|
|
945
|
+
this.unmarkSelection(() => {
|
|
946
|
+
this.performClientsideFilter();
|
|
930
947
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
948
|
+
if (markResults) {
|
|
949
|
+
this.markSelection();
|
|
950
|
+
}
|
|
951
|
+
});
|
|
934
952
|
|
|
935
953
|
return true;
|
|
936
954
|
}
|
|
@@ -1325,44 +1343,33 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
1325
1343
|
loadPromise = mySelf.customAjaxCall(mySelf.getAjaxArgs(paginationPosition, paginationLength));
|
|
1326
1344
|
}
|
|
1327
1345
|
|
|
1328
|
-
const unmark = (cb: () => void) => {
|
|
1329
|
-
if (DataTableConfig.filterMarking) {
|
|
1330
|
-
mySelf.markInstance.unmark({
|
|
1331
|
-
done: function () {
|
|
1332
|
-
cb();
|
|
1333
|
-
},
|
|
1334
|
-
});
|
|
1335
|
-
} else {
|
|
1336
|
-
cb();
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
1346
|
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
});
|
|
1347
|
+
|
|
1348
|
+
loadPromise.then((data: any) => {
|
|
1349
|
+
mySelf.unmarkSelection(() => {
|
|
1350
|
+
mySelf.enforceBodyRedraw = true;
|
|
1351
|
+
mySelf.$nextTick(() => {
|
|
1352
|
+
mySelf.enforceBodyRedraw = false;
|
|
1353
|
+
mySelf.isLoading = false;
|
|
1354
|
+
|
|
1355
|
+
if (mySelf.parseLoadedRowset != null) {
|
|
1356
|
+
let rowset = mySelf.parseLoadedRowset(data);
|
|
1357
|
+
mySelf.totalCount = rowset.TotalCount;
|
|
1358
|
+
mySelf.totalFilteredCount = rowset.TotalFilteredCount;
|
|
1359
|
+
mySelf.rows = rowset.Rows;
|
|
1360
|
+
} else {
|
|
1361
|
+
mySelf.totalCount = data.TotalCount;
|
|
1362
|
+
mySelf.totalFilteredCount = data.TotalFilteredCount;
|
|
1363
|
+
mySelf.rows = data.Rows;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
mySelf.loadedRows = mySelf.rows;
|
|
1367
|
+
mySelf.$forceUpdate();
|
|
1368
|
+
mySelf.$nextTick(() => mySelf.markSelection());
|
|
1369
|
+
resolve(data);
|
|
1364
1370
|
});
|
|
1365
|
-
})
|
|
1371
|
+
});
|
|
1372
|
+
})
|
|
1366
1373
|
.catch((err) => {
|
|
1367
1374
|
mySelf.isLoading = false;
|
|
1368
1375
|
NotificationProvider.showErrorMessage(PowerduckState.getResourceValue('errorFetchingData'));
|