gd-bs 6.9.13 → 6.9.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.9.13",
3
+ "version": "6.9.15",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -174,7 +174,7 @@ class _Table extends Base<ITableProps> implements ITable {
174
174
 
175
175
  // Renders a row
176
176
  private renderRow(row: HTMLTableRowElement, data, rowIdx: number) {
177
- // See if columns
177
+ // Parse the columns
178
178
  for (let i = 0; i < this.props.columns.length; i++) {
179
179
  // Create the cell
180
180
  this.renderCell(row, this.props.columns[i], data, rowIdx);
@@ -206,5 +206,45 @@ class _Table extends Base<ITableProps> implements ITable {
206
206
  }
207
207
  }
208
208
  }
209
+
210
+ // Method to update a column element
211
+ updateColumn(elCol: HTMLElement, colIdx: number, row: any) {
212
+ // Get the column
213
+ let colProps = this.props.columns[colIdx];
214
+ if (colProps) {
215
+ // Set the value
216
+ elCol.innerHTML = row[colProps.name] == null ? "" : row[colProps.name];
217
+
218
+ // See if there is an event for this column
219
+ if (colProps.onRenderCell) {
220
+ // Call the event
221
+ colProps.onRenderCell(elCol as HTMLTableCellElement, colProps, row);
222
+ }
223
+
224
+ // See if there is an event for this component
225
+ if (this.props.onRenderCell) {
226
+ // Call the event
227
+ this.props.onRenderCell(elCol as HTMLTableCellElement, colProps, row);
228
+ }
229
+ }
230
+ }
231
+
232
+ // Method to update a row element
233
+ updateRow(elRow: HTMLElement, row: any) {
234
+ // Parse the columns
235
+ for (let i = 0; i < this.props.columns.length; i++) {
236
+ let elCol = elRow.children[i] as HTMLElement;
237
+ if (elCol) {
238
+ // Update the column
239
+ this.updateColumn(elCol, i, row);
240
+ }
241
+ }
242
+
243
+ // See if there is an event
244
+ if (this.props.onRenderRow) {
245
+ // Call the event
246
+ this.props.onRenderRow(elRow as HTMLTableRowElement, row);
247
+ }
248
+ }
209
249
  }
210
250
  export const Table = (props: ITableProps, template?: string): ITable => { return new _Table(props, template); }
@@ -78,6 +78,10 @@ export interface ITable {
78
78
 
79
79
  /** Shows the table. */
80
80
  show: () => void;
81
+
82
+ updateColumn: (elCol: HTMLElement, colIdx: number, row: any) => void;
83
+
84
+ updateRow: (elRow: HTMLElement, row: any) => void;
81
85
  }
82
86
 
83
87
  /**