@@ -281,20 +281,33 @@ export class CellListComponent implements OnInit, OnDestroy, DoCheck {
281281 if ( data [ 'points' ] && data [ 'points' ] [ 0 ] [ 'customdata' ] ) {
282282 // console.log('data[points][0] is: ', data['points'][0]);
283283 this . clickedUnitId = data [ 'points' ] [ 0 ] [ 'customdata' ] ;
284- for ( const [ ind , row ] of Object . entries ( rows ) ) {
285-
286-
287- // console.log('row inner text is - ', row['innerText']);
284+ // for (const [ind, row] of Object.entries(rows)) {
285+ // // console.log('row inner text is - ', row['innerText']);
286+ // if (this.clickedUnitId == row['innerText'].split(' ')[0]) {
287+ // console.log('row1 is: ', row)
288+ // console.log('row unit id is - ', row['innerText'].split(' ')[0]);
289+ // const unitId = row['innerText'].split(' ')[0];
290+ // this.clickedUnitIndex = parseInt(ind, 10);
291+ // row.scrollIntoView({
292+ // behavior: 'smooth',
293+ // block: 'center'
294+ // });
295+ // }
296+ // }
297+ let rowIndex = 0 ;
298+ for ( const row of rows ) {
299+ // console.log('inside second loop');
288300 if ( this . clickedUnitId == row [ 'innerText' ] . split ( ' ' ) [ 0 ] ) {
289- // console.log('row unit id is - ', row['innerText'].split(' ')[0]);
290- const unitId = row [ 'innerText' ] . split ( ' ' ) [ 0 ] ;
291- this . clickedUnitIndex = parseInt ( ind , 10 ) ;
301+ // console.log('row2 is: ', row)
302+ // console.log('row unit2 id is - ', row['innerText'].split(' ')[0]);
303+ this . clickedUnitIndex = rowIndex ;
304+ // console.log('index 2 - ', rowIndex);
292305 row . scrollIntoView ( {
293306 behavior : 'smooth' ,
294307 block : 'center'
295308 } ) ;
296309 }
297-
310+ rowIndex += 1 ;
298311 }
299312
300313 // rows[this.clickedUnitId].scrollIntoView({
0 commit comments