I have two child components which has wj-flex-grid table and having one parent component in which these two child components are added. I want to sync the row height of both the tables whenever the content of any table row height change other table row height should also align to it.
I was trying to check the rowHeight of both the tables whichever has bigger row height it should set that row height. I found there is one event which is onResizingRow() but not able to use it properly.
Code Example- grid.component.html-
<wj-flex-grid>
(resizedRow)="onResizedRow($event)">
</wj-flex-grid>`
I have added the below line of code in
grid.component.ts-
onResizedRow(args: CellRangeEventArgs): void {
this.resizedRow.emit(args);
}
Parent component html file-
(resizedRow)="onResizedRow($event, 'ageToAge')"
in ts file-
onResizedRow(args: CellRangeEventArgs): void {
console.log(args);
}
Child1 component html file added this line in app-grid(which is a grid component)
(resizedRow)="onResizedRow($event)"
in ts file-
onResizedRow(args: CellRangeEventArgs): void {
this.resizedRow.emit(args);
}
I am just consoling it to check whether this method is called or not. It is unfortunately when changing the row it is not calling.
Can anyone provide me any solution for it.
i am not shure that the below example is best approach ,there because it uses the service to talk between these two component but so far this is what i an think of , so try the below.
1st create a service
now in the components implement the below logic as according to your str. (i can't customize as we don't have all the details so if there is any tweak is needed then do it accordingly )
for 2nd component follow the below
as i did not run it by my self,so i need you to verify the results ,so that i can fix any if needed.