Skip to Content
Nov 09, 2018 at 01:44 PM

How to get visibility of all items in m.table which has a growing feature



In the below code , if I am setting the threshold, I am not able to get visibility of all the items. the table has 15 values now and its has to be loaded on scroll with the threshold of 5. Also the table has to set to "Navigation type" once the dataReceived event is called in which the table is binded with data and it has to navigate to the next page.

In the controller logic, getItems is taking only the 5 values and sets the navigation to the table's first five rows. While the page is scrolled its not loading the next five items also its showing the error " Cannot read property 'destroy' of undefined"error.png


<smartTable:SmartTable id="smartTable" entitySet="h_set" smartFilterId="smartFilterBar" tableType="ResponsiveTable"initialise="onInitialise" demandPopin="true" initiallyVisibleFields="a,b,c,d,e" header="Rules"showRowCount="true" persistencyKey="smartTable_Persist" enableAutoBinding="false" dataReceived="onDataReceived" requestAtLeastFields="a,b,c,d,e" fieldChange="onFieldChange" useExportToExcel="true" ignoreFromPersonalisation="S,d,e,f">
	<Table growing="true" growingScrollToLoad="true"  growingThreshold="5" >
			<Column id="a" hAlign="Begin">
			<core:CustomData key="p13nData" value="\{"columnKey": "a", "columnIndex":"4", "leadingProperty": "a"}"/>
			<Text text="{i18n>a}"/>
			<Column id="b" hAlign="Begin">
			<core:CustomData key="p13nData" value="\{"columnKey": "b", "columnIndex":"5", "leadingProperty": "b"}"/>
			<Text text="{i18n>b}"/>
		<ColumnListItem type="">
		<DatePicker id="vFrom" value="{path:'From',type: 'sap.ui.model.type.Date',formatOptions: {style: 'medium'}}" change="onFromChange" displayFormat="medium" enabled="false"/>
		<DatePicker id="vTo" value="{path:'To',type: 'sap.ui.model.type.Date',formatOptions: {style: 'medium'}}" change="onDatePickerChange"displayFormat="medium" enabled="false"/>
	<Input type="Text" value="{Description}" id="inputDes" liveChange="onLiveChange"/>
	<CheckBox selected="{RwS}" id="checkS" select="onLiveChange"/>
<CheckBox selected="{S}" id="checkS" enabled="false" select="onLiveChange"/>

Controller Logic: getItems()[i] is looped only for initial growing value.So how to get the full row items on scroll?

onDataReceived: function(event) {
for (var i = 0; i < this.getView().byId("smartTable").getTable().getItems().length; i++) {
this.getView().byId("smartTable").getTable().getItems()[i].attachPress(this.onItemPress, this);


error.png (15.6 kB)