File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff 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 ( ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ const types = new Map<string, any>([
2020} )
2121export 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 ) ;
You can’t perform that action at this time.
0 commit comments