We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

scrollTo in `.fm-scroll-content`

Answered
Chad Baudoin asked on November 3, 2019

Hi, I am trying to use a link external to flexmonster to trigger the highlighting of a certain row in the flexmonster pivot table.  The link triggered this to scroll the .fm-scroll-content to the right place. 

const scrollContents = pivotTable.$el.querySelectorAll('.fm-scroll-pane .fm-scroll-content');
const spreadSheetEl = scrollContents[scrollContents.length - 1];
const cellHeights = parseInt(spreadSheetEl.querySelector('.fm-cell').style.height, 10);
spreadSheetEl.style.top = `-${cellHeights * varianceData.index}px`;

 That didn't work because of the dynamic swapping of data past a certain row number (in this case `<div class="fm-row" data-r="17">` ) .

Is there a way to scrollTo a certain row number that is outside of the visible area, programmatically? 

I'm only working with about 400 rows of data, so loading all of the data in line, is an option.

1 answer

Public
Vera Didenko Vera Didenko Flexmonster November 5, 2019

Hello, Chad,
 
Thank you for your question.
 
Yes, it is possible to scroll down on a certain distance.
Please see the following thread for details: https://www.flexmonster.com/question/move-focus-on-a-specific-cell/
 
Please let us know if you have any questions.
 
Best Regards,
Vera

Please login or Register to Submit Answer