on 2018 Nov 09 1:44 PM
Hi,
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
View.xml
<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" >
<columns>
<Column id="a" hAlign="Begin">
<customData>
<core:CustomData key="p13nData" value="\{"columnKey": "a", "columnIndex":"4", "leadingProperty": "a"}"/>
</customData>
<Text text="{i18n>a}"/>
</Column>
<Column id="b" hAlign="Begin">
<customData>
<core:CustomData key="p13nData" value="\{"columnKey": "b", "columnIndex":"5", "leadingProperty": "b"}"/>
</customData>
<Text text="{i18n>b}"/>
</Column>
</columns>
<items>
<ColumnListItem type="">
<cells>
<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"/>
</cells>
</ColumnListItem>
</items>
</Table>
</smartTable:SmartTable>
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].setType("Navigation");
this.getView().byId("smartTable").getTable().getItems()[i].attachPress(this.onItemPress, this);
}
}
Dear Aruna
I am assuming that you want to set the navigation only for few table items.
If that is the case, you can use the formatter which dynamically sets the navigation type based on your data..
create a formatter in the controller and assign it to the type=".navigationFormatter"
and return Navigation based on your condition.
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.