on 03-26-2013 9:28 AM
Hi All,
I have create a simple SAPUI5 application, with a table. Each row in the table has a check box, and there is a button in the table header.
Now on click of this button in the table header, I want to loop through all the rows in the table and extract the rows, with checkbox selected. I tried using the getRows() method of the Table UI, but this method returns only the set of rows, that are displayed on the table. I mean, even if the table has 50 rows and the visible row count is set to 5, this method returns only those 5 visible rows.
Also, is there a way to bind the double click event, to each row in a table? In this event handler, i want to open a popup window.
Please help me in implementing these. Any pointers on these, would be of great help!
Thanks & Regards,
Vishweshwara P.K.M.
Try the above link....and view Page Source ...I think it might be little Helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishweshwara,
please use the model, not the table...
Best Regards
Konstantin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Konstantin,
Thanks for your replay.
I tried to use model as well, but the getProperty() method of the model, needs the context. I didn't get the way to pass the context of each row to this method, to be able to check all the entities present in the model. Can you please elobarate on how to use model in this case?
Thanks & Regards,
Vishweshwara P.K.M.
Hi Konstantin,
The custom data/local data object, bound to a table through JSONModel, can be accessed by means of an array. But my question, was for ODataModel. If I bind the table to the OData fetched from a Gateway Service, then how do I do this looping. Can we get an array out of the OData model and loop through that? If yes, please let me know, how to do this.
Thanks & Regards,
Vishweshwara P.K.M.
Oh... oData. Now I got it.
I suppose it's not possible to get all value, if you request only some of them for the table. According to Dev. Guide.
The ODataModel enables binding of controls to data from OData services. The ODataModel is a server-side model, so the whole dataset is only available on the server, the client only nows the currently visible rows and fields. This also means sorting and filtering on the client is not possible, the client has to send a request to the server to accomplish these tasks.
Best Regards
Konstantin
Hi Vishweshwara,
We can get an array from oData. Use JSONmodel to do that.
var country=new Array();
$.getJSON(odata-url,function(data) {
oModel.setData({country_data : data.d.results});
for (i = 0; i < data.d.results.length; i++) {
country[i] = oModel.oData.country_data[i].COUNTRY_NAME;
}});
So that you can get an array of countries from oData which is having path like this...
d/results/COUNTRY_NAME
Regards,
Surendra.
User | Count |
---|---|
90 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.