Restore vertical scrollbar position of panels after refresh

I'm using angular 6 and I have a page with several primeNg panel (component created with recursion) and I would like to restore the position of each scrollbar after an event that reload all of them. I set an id for each panel(and saved all into a service) and I tried with


but always return 0 and with


but return always the same value even if I scroll down.

This is the piece of code where I set the id:

<div id="{{idCard}}" class="div-container" *ngIf="(currentCard.propName || || inputIsInSearchMode==false " [ngClass]="{'minicard-style': !isToggleable || !(depth < maxLevelJsonSchema)}" >
    <p-panel [collapsed]="!isToggleable || !(depth < maxLevelJsonSchema)" [toggleable]="isToggleable && (depth < maxLevelJsonSchema)" (click)="cardClickedEvent()" expandIcon="pi pi-chevron-up" collapseIcon="pi pi-chevron-down">

I tried even in p-panel with the same result. Can You help me?