on 12-29-2014 6:42 AM
hi,
iam performing an odata read from controller of ,say login view and passing data to another view(dashboard) like below
OData.read({ requestUri:
"url",
headers: { "X-Requested-With": "XMLHttpRequest", "sap-user" : username, "sap-password" : password, "Content-Type": "application/atom+xml" },
},
function (data) {
var oModel = new sap.ui.model.json.JSONModel();
var myData = {};
var jsonDashboard = {"mycollection":[]};
for(i = 0;i<data.results.length;i++){
//code for filling jsonDashboard array
}
myData.Products = data.results; |
myData.Dashboard = jsonDashboard.mycollection;
oModel.setData(myData);
sap.ui.getCore().setModel(oModel);
// sap.ui.getCore().setModel(oModel, "mydashboardModel");
sap.ui.core.BusyIndicator.hide();
// sap.ui.getCore().getModel("mydashboardModel").updateBindings(true);
app.to("Dashboard",data);
},
function(err){
// window.alert("error: "+ err.message);
// bsydialog.close();
sap.ui.core.BusyIndicator.hide();
window.alert("error");
}
);
what i need is to create tiles based on myData.Dashboard data in dashboard view..
myData will look like
var myData = { "Products":[{
product : "Prod 1",
revenue : 500000
}, {
product : "Prod 2",
revenue : 700000
}],
"Dashboard":[{
module : "sd",
count : 5,
},
{
module : "mm",
count : 6
}]
};
data may varry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis,
Thanks for the light.
i used
var container = new sap.m.TileContainer("idTileContainer", {
allowAdd : true,
editable : false,
});
var moduleTile = new sap.m.StandardTile({
title : '{Module}',
number: '{Count}'
});
container.bindAggregation("tiles", "/Graph", moduleTile);
now it work fine
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh
Below is an example of creating tiles on homepage. It is using the JSON data which you can replace with your oData calls
https://gist.github.com/elsewhat/6078885
Thanks
Nabheet
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.