on 04-13-2016 9:42 AM
Hi,
I want to get table row count, there is no issue in binding the data to table. But I couldn't able to get the row count.
oTable.bindAggregation("items", {
path: "/VbakSet",
template: oItemTemplate,
filters: filters
});
//Logic to get the row count
var tab = this.getView().byId("idVbakTable");
//get binding path of table items
var bindingPath = tab.getBinding("items").sPath;
//get data model of table
var model = tab.getModel();
//get bind data
var data = model.getProperty(bindingPath);
//get total rows number
var rowCount = data.length; “ Here I am getting Error – Not able to read the length
console.log(" >> ", rowCount);
alert(rowCount);
},
I have tried with various methods, but not able to get the simple row count.
probably the timing. can you run the same code in onafterrendering
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kishore,
Everything looks fine. Does your model has a name?
Try to check the console for 'data' variable:
var data = model.getProperty(bindingPath);
console.log(data);
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.