I am trying to implement infinite scroll i.e., load data on demand in a table rendered using HandsOnTable Plugin. The table is the part of the XML view designed using SAPUI5. I tried something mentioned here. But the position value that is returned by scrollTop method is greater than the document and window height even when the user has not scrolled till the end of the table. For e.g. the value returned by scrollTop is 670 and the $(window).height() value is 325.
I also tried using InfiniteScroll Plugin, but with no luck. My XML View is designed as follows.
<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m" controllerName="poc.itemdesc" xmlns:html="http://www.w3.org/1999/xhtml">
<Page title="Title">
<content>
<Panel xmlns="sap.m" id="iPanel" headerText="Items table"
width="100%" height="auto" expandable="false" expanded="false"
expandAnimation="true" expand="">
<content>
<HTML xmlns="sap.ui.core" id="HTMLCon" busy="false"
busyIndicatorDelay="1000" visible="true"
content="<div id='sheetContainer' style='width: 100%; height: 550px; overflow: auto' data-originalstyle='width: 100%; height: 450px; overflow: auto' class='handsontable'></div>"
preferDOM="true" sanitizeContent="false" afterRendering="HandsOnTbl">
</HTML>
</content> <!-- sap.ui.core.Control -->
</Panel>
</content>
</Page>
The code into the controller for HandsOnTable goes as follows,
HandsOnTbl : function(oEvent){
var container = document.getElementById('sheetContainer');
console.log(container);
var settingsHOT = {
data : Handsontable.helper.createSpreadsheetData(500, 10),
colHeaders : [ "Item #",
"Attribute Name", "Attribute Value",
"Attribute Name", "Attribute Value",
"Attribute Name", "Attribute Value",
],
contextMenuCopyPaste : {
swfPath : "res/ZeroClipboard.swf"
},
search : true,
rowHeaders : true,
contextMenu : true
};
HOT = new Handsontable(container, settingsHOT);
}
Please help implement the infinite scroll.