on 03-07-2017 5:10 AM
In sap.ui.table.table, get rows count till last scroll.
Hi Prachi,
If your SAPUI5 version is higher than the 1.37. SAP has provided one event(firstVisibleRowChanged) for getting firstVisibleRow count. this event fires on Scrolling table. for more details go through API UI Table Event
Just try by modified below code:
XML:
<table:Table id="tableId"
threshold="100"
selectionMode="MultiToggle"
enableBusyIndicator="false"
visibleRowCount="10"
fixedColumnCount="2"
rowHeight="39"
showNoData="true"
firstVisibleRowChanged="onScroll"
>
Controller:
onScroll : function() {
var iCount = this.getView().byId("tableId").getVisibleRowCount() + oEvent.getParameter("firstVisibleRow");
alert(iCount);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is exactly what I am looking for!!
Thank you Vedaradhya. 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If your sapui5 version is 1.28, then try by modifying controller code. shown below
XML:
<table:Table id="tableId"
threshold="100"
selectionMode="MultiToggle"
enableBusyIndicator="false"
visibleRowCount="10"
fixedColumnCount="2"
rowHeight="39"
showNoData="true">
Controller:
onButtonPress: function() {
var oTable = this.getView().byId("tableId");
var selectedRow = oTable.getVisibleRowCount() + oTable.getFirstVisibleRow();
alert(selectedRow);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
all your data is in the model. what u want to do? you can also count the row there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
we are using version 1.28
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijay,
No issue with scrollbar or data.
In my Table, visibleRowCount is 10.
If I scroll down till 50 records then the loaded data (records) is 50; however the rows visible to end user are 10 only as mentioned above.
So my requirement is on Button press I want the data as 50; or 30 or whatever the number of records that are loaded on scroll.
Using the below does not fulfill my objective.
var selectedRow = oTable.getVisibleRowCount().length;
I get 10 records and not 50.
Any suggestions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prachi,
Not clear in your question, can you please elobrate, whether you want scroll bar or full data in the table????
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
below is the code:
XML:
<table:Table id="tableId"
threshold="100"
selectionMode="MultiToggle"
enableBusyIndicator="false"
visibleRowCount="10"
fixedColumnCount="2"
rowHeight="39"
showNoData="true">
Controller:
onButtonPress: function() {
var oTable = this.getView().byId("tableId");
var selectedRow = oTable.getVisibleRowCount();
alert(selectedRow);
}
After scroll selectedRow is "10". But my requirement is till scroll I want row count should be dynamic.
For example if I scroll till 30 rows I should be able to get the row count as 30. Please let me know if you have any idea on how to achieve this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.