@memberjunction/ng-user-view-grid 0.9.67 → 0.9.69

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.
@@ -392,7 +392,7 @@ export class UserViewGridComponent {
392
392
  tempGridState.sortSettings = this._newGridState.sortSettings ? this._newGridState.sortSettings : tempGridState.sortSettings;
393
393
  // now stringify the grid state and save it
394
394
  this._viewEntity.Set('GridState', JSON.stringify(tempGridState));
395
- const newSortState = tempGridState.sortSettings.map((s) => { return { field: s.field, direction: s.dir === 'asc' ? 1 : 2 }; });
395
+ const newSortState = tempGridState.sortSettings.map((s) => { return { field: s.field, direction: s.dir }; });
396
396
  const oldSortState = JSON.parse(this._viewEntity.Get('SortState'));
397
397
  this._viewEntity.Set('SortState', JSON.stringify(newSortState));
398
398
  if (yield this._viewEntity.Save()) {
@@ -484,13 +484,19 @@ export class UserViewGridComponent {
484
484
  }
485
485
  sortChanged(sort) {
486
486
  return __awaiter(this, void 0, void 0, function* () {
487
- this._newGridState.sortSettings = sort;
488
- this.sortSettings = sort; // for the UI display - grid binding to this shows that the sort is applied via arrows in the column headers
487
+ if (sort && sort.length > 0) {
488
+ // remove any sort settings that don't have a direction
489
+ const filterSort = sort.filter((s) => s.dir !== undefined && s.dir !== null && s.dir !== "");
490
+ this._newGridState.sortSettings = filterSort;
491
+ }
492
+ else
493
+ this._newGridState.sortSettings = sort;
494
+ this.sortSettings = this._newGridState.sortSettings; // for the UI display - grid binding to this shows that the sort is applied via arrows in the column headers
489
495
  if (this.IsDynamicView()) {
490
496
  // Dynamic View, we have this.Params and can add an OrderBy and then just Refresh() the entire component
491
497
  // that will result in going to the server for a refreshed set of data
492
498
  if (this.Params) {
493
- this.Params.OrderBy = sort[0].field + ' ' + (sort[0].dir === 'asc' ? 'ASC' : 'DESC');
499
+ this.Params.OrderBy = sort[0].field + ' ' + (sort[0].dir);
494
500
  this.Refresh(this.Params);
495
501
  }
496
502
  else {
@@ -732,7 +738,7 @@ export class UserViewGridComponent {
732
738
  // sorting setup
733
739
  if (this._viewEntity) {
734
740
  const temp = this._viewEntity.ViewSortInfo;
735
- const kendoSortSettings = temp.map((s) => { return { field: s.field, dir: s.direction === 1 ? 'asc' : 'desc' }; });
741
+ const kendoSortSettings = temp.map((s) => { return { field: s.field, dir: s.direction.trim().toLowerCase() }; });
736
742
  this.sortSettings = kendoSortSettings;
737
743
  }
738
744
  this.skip = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-user-view-grid",
3
- "version": "0.9.67",
3
+ "version": "0.9.69",
4
4
  "description": "MemberJunction: Angular Grid to display dynamic and saved user views for any entity in MemberJunction.",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -26,11 +26,11 @@
26
26
  "@progress/kendo-angular-grid": "^12.1.0"
27
27
  },
28
28
  "dependencies": {
29
- "@memberjunction/core-entities": "^0.9.57",
30
- "@memberjunction/global": "^0.9.89",
31
- "@memberjunction/core": "^0.9.86",
32
- "@memberjunction/ng-compare-records": "^0.9.87",
33
- "@memberjunction/ng-container-directives": "^0.9.63",
29
+ "@memberjunction/core-entities": "^0.9.59",
30
+ "@memberjunction/global": "^0.9.91",
31
+ "@memberjunction/core": "^0.9.88",
32
+ "@memberjunction/ng-compare-records": "^0.9.89",
33
+ "@memberjunction/ng-container-directives": "^0.9.65",
34
34
  "tslib": "^2.3.0"
35
35
  },
36
36
  "sideEffects": false