on 07-07-2015 4:41 AM
Hi All,
I have a table which I am binding with Odata using oTable.bindItems but after Binding if I check length of items in table it shows me only the number that has been mentioned in growing. Suppose I have 10 items in the list and my growing threshold is 4 so this items.length gives me 4 but i am expecting it to be 10. how to achieve this?
Thanks & Regards,
Mansi
Hi,
Thanks for replying.
But my problem is not solved.
oTable.getItems() gives me items but
oTable.getModel().getData() is null.
How to get the complete length. Please help. I am stuck.
Thanks,
Mansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try like this,
oTable.getModel("TablebindedModel").getProperty('/modelData');
In my case in table - items="{oTableData>/aTableData}"
so ,
var oTableModel = oTable.getModel("oTableData");
if(oTableModel != undefined)
console.log(oTableModel.getProperty('/modelData'));
//In console the table data is displayed.
He is using ODataModel, so not all data is already loaded in the model.
And the reason you don't see any data yet is because your data is loaded asynchronously. You cannot call getData right after you set your model.
But you can get the count from the binding, even if not everything is loaded yet:
onAfterRendering : function() {
var oBindings = this.getView().getModel().bindList("/Customers");
console.log(oBindings.getLength());
}
ODataListBinding.getLength() should return you the whole legth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
items.length will gives the count of only the shown data. so use use your table model length.
at the time of binding you will get all the records.
so ,
var oModel1 = new sap.ui.model.json.JSONModel();
oModel1.setData(data);
aData = oModel1.getProperty("/d/results");
console.log(aData.length);//will gies the length of your table data.
else,
get the table model and see the length like above.
oTable.getModel().getData().length;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.