@rangertechnologies/ngnxt 2.1.112 → 2.1.113

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.
@@ -4828,7 +4828,7 @@ class NxtDatatable {
4828
4828
  renderer;
4829
4829
  dataService;
4830
4830
  changeService;
4831
- data; // get data that to be displayed in a array
4831
+ data = []; // get data that to be displayed in a array
4832
4832
  columns = []; // Columns have a label, a column type, and filter details.
4833
4833
  withCheckBox; // get if with or without checkbox in table
4834
4834
  searchBar; // if it is true, the search bar will be displayed on table
@@ -4943,6 +4943,7 @@ class NxtDatatable {
4943
4943
  this.changeService = changeService;
4944
4944
  }
4945
4945
  ngOnChanges() {
4946
+ this.dataSource = { data: [] }; // or use a proper data structure
4946
4947
  console.log("ngOnChanges is running");
4947
4948
  // SKS13MAR25 To get the data from data question
4948
4949
  if (this.from === 'ngNxt') {
@@ -5032,7 +5033,18 @@ class NxtDatatable {
5032
5033
  }
5033
5034
  }
5034
5035
  }
5035
- this.dataSource = this.data;
5036
+ // Ensure `this.data` is an array
5037
+ if (!this.data || !Array.isArray(this.data)) {
5038
+ console.warn('Data is not initialized or is not an array');
5039
+ this.data = []; // Initialize as an empty array if it's not valid
5040
+ return;
5041
+ }
5042
+ // Ensure `this.data` is not empty
5043
+ if (this.data.length === 0) {
5044
+ console.warn('Data is empty, waiting for data to be loaded');
5045
+ return;
5046
+ }
5047
+ // Ensure `this.dataSource.data` is initialized
5036
5048
  //SKS15FEB25 Initialize this in your data fetch method
5037
5049
  this.originalData = [...this.data];
5038
5050
  this.sFilterData = [...this.data];
@@ -5105,6 +5117,7 @@ class NxtDatatable {
5105
5117
  }, 1500); // Waits 100ms for rendering
5106
5118
  }
5107
5119
  ngOnInit() {
5120
+ this.dataSource = { data: [] }; // or use a proper data structure
5108
5121
  // SKS13MAR25 get data from question if from ngNxt
5109
5122
  if (this.from === 'ngNxt') {
5110
5123
  this.data = this.question?.input ? this.question?.input : [];
@@ -11824,14 +11837,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
11824
11837
  /* tslint:disable */
11825
11838
  const VERSION = {
11826
11839
  "dirty": true,
11827
- "raw": "edbbbf0-dirty",
11828
- "hash": "edbbbf0",
11840
+ "raw": "ef57944-dirty",
11841
+ "hash": "ef57944",
11829
11842
  "distance": null,
11830
11843
  "tag": null,
11831
11844
  "semver": null,
11832
- "suffix": "edbbbf0-dirty",
11845
+ "suffix": "ef57944-dirty",
11833
11846
  "semverString": null,
11834
- "version": "2.1.109"
11847
+ "version": "2.1.113"
11835
11848
  };
11836
11849
  /* tslint:enable */
11837
11850