Posted 6 May 2020, 11:00 pm EST
Because I scrolled to the bottom which has a gray background ,I would like to add some buttons to handle custom events. maybe I should append the fixed dom or draw with canvas.
Forums Home / Spread / SpreadJS
Posted by: 122368177 on 6 May 2020, 11:00 pm EST
Posted 6 May 2020, 11:00 pm EST
Because I scrolled to the bottom which has a gray background ,I would like to add some buttons to handle custom events. maybe I should append the fixed dom or draw with canvas.
Posted 7 May 2020, 3:02 am EST
Hi,
I’m sorry but I’m unable to understand the requirement. Could you please explain more about your requirement?
Regards
Posted 7 May 2020, 3:31 am EST
Hi,
when I scroll the scroll bar to the canvas bottom, I need to add a button to handle setRowCount(count)
Posted 11 May 2020, 12:20 am EST
Hi,
You may use TopRowChaged Event to check the whether the last is visible to the viewport once you get to the last row you just need to show a button that handles addRow functionality you may also implement infinite scrolling for that you just need to add rows once the last row is about to visible to the viewport please refer to the following code snippet and attached sample which demonstrates the sample
samples:
addRowButton: https://codesandbox.io/s/zealous-tree-p19kl
spread.bind(GC.Spread.Sheets.Events.TopRowChanged, (e, args) => {
if (args.sheet.getViewportBottomRow(1) === args.sheet.getRowCount() - 1) {
document.getElementById("addRows").style.display = "block";
}
});
infinite scrolling: https://codesandbox.io/s/naughty-lumiere-c6vz1
Regards