Skip to content

Commit 866af6b

Browse files
committed
Maybe this.
1 parent b970bb0 commit 866af6b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/pg/table/table.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export default class PgTable extends HTMLElement {
6060
if (this.columns.length === 0) {
6161
throw 'columns must be set before data';
6262
}
63-
$item.rows = this.data;
6463
$item.columns = this.columns;
6564
$item.addEventListener('action', (e: any) => {
6665
e.stopPropagation();

src/pg/tableRow/tableRow.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const types = new Map<string, any>([
2020
})
2121
export default class PgTableRow extends HTMLElement {
2222
@Prop() index: number;
23-
@Prop() rows: any[] = [];
2423
@Prop() items: any[] = [];
2524
@Prop() key: string = '';
2625
@Prop() columns: any[] = [];
@@ -52,7 +51,9 @@ export default class PgTableRow extends HTMLElement {
5251
index: this.index,
5352
key: item.key,
5453
getRows: () => {
55-
return this.rows.map((row) => {
54+
if (!this.parentNode) { return; }
55+
const items = Array.from(this.parentNode.children) as PgTableRow[];
56+
return items.map((row) => {
5657
return {
5758
getColumn: (key: string) => {
5859
return row.items.find(x => x.key === key);

0 commit comments

Comments
 (0)