on ‎2015 Dec 14 5:51 AM
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sap.ui.jsview("view.controllersTile", {
/** Specifies the Controller belonging to this View.
* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
* @memberOf cddemoapp.launchpage
*/
getControllerName : function() {
return"";
},
/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
* Since the Controller is given to this method, its event handlers can be attached right away.
* @memberOf cddemoapp.launchpage
*/
createContent : function(oController) {
var oBulletChart = new sap.suite.ui.commons.DynamicContainer({
tiles : [
new sap.suite.ui.commons.GenericTile({
header : 'Manual Override ',
// subheader : 'Close Status',
size : sap.suite.ui.commons.InfoTileSize.L ,
frameType : sap.suite.ui.commons.FrameType.TwoByOne,
// backgroundImage : 'https://36.media.tumblr.com/4c1c24d32d29fe4d2667102a67b07d05/tumblr_nfeoirox8O1qi1d8wo3_500.png',
headerImage : '',
press : function(){alert();},
tileContent : [
new sap.suite.ui.commons.TileContent({
footer : 'AUTOMATED:2069',
content : [
new sap.suite.ui.commons.ComparisonChart({
data : [
new sap.suite.ui.commons.ComparisonData({
title : 'Override',
value : 56,
color : 'Critical'
})
]
})
]
})
]
})
]
});
return(oBulletChart);
}
});
sai it is the code i am using
Shahid,
Give a name to your model. I changed the code using named model, check the sample: Plunker
Regards,
Sai Vellanki.
it is my view.js
sap.ui.jsview("view.controllersTile1", {
/** Specifies the Controller belonging to this View.
* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
* @memberOf routingdemo.App
*/
getControllerName: function() {
return "view.controllersTile1";
},
/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
* Since the Controller is given to this method, its event handlers can be attached right away.
* @memberOf routingdemo.App
*/
createContent: function(oController) {
this.setHeight("100%");
var oTemplate = new sap.suite.ui.commons.ComparisonData({
title: "{AmountType}",
value: "{AmountSum}",
color: {
path: 'AmountSum',
formatter: function(v) {
if (v > 2000) {
return "Critical";
} else{
return "Good";
}
return parseInt(v);
}
}
});
var oChart = new sap.suite.ui.commons.ComparisonChart();
oChart.bindAggregation("data", {
path: "ComparisonModel>/",
template: oTemplate
});
var oBulletChart = new sap.suite.ui.commons.DynamicContainer({
tiles: [
new sap.suite.ui.commons.GenericTile({
header: 'Manual Override ',
// subheader : 'Close Status',
size: sap.suite.ui.commons.InfoTileSize.L,
frameType: sap.suite.ui.commons.FrameType.TwoByOne,
// backgroundImage : 'https://36.media.tumblr.com/4c1c24d32d29fe4d2667102a67b07d05/tumblr_nfeoirox8O1qi1d8wo3_500.png',
headerImage: '',
press: function() {
alert();
},
tileContent: [
new sap.suite.ui.commons.TileContent({
//footer: 'AUTOMATED:2069',
content: [oChart]
})
]
}).addStyleClass("myCustomTile")
]
});
return (oBulletChart);
}
});
My controller.js
sap.ui.controller("view.controllersTile1", {
/**
* Called when a controller is instantiated and its View controls (if available) are already created.
* Can be used to modify the View before it is displayed, to bind event handlers and do other one-time initialization.
* @memberOf table_v01.Main
*/
onInit: function() {
var aData = [{
"ContractNumber": "0000010000850",
"AmountType": "REP",
"AmountSum": 3460
}, {
"ContractNumber": "0000010000850",
"AmountType": "INT",
"AmountSum": 341
}, {
"ContractNumber": "0000010000850",
"AmountType": "FEE",
"AmountSum": 1560
}];
var model = new sap.ui.model.json.JSONModel();
model.setData(aData);
sap.ui.getCore().setModel(model,"ComparisonModel");
}
});
Shahid,
There you go, you have to bind the model name to your property values as well.
sap.suite.ui.commons.ComparisonData({
title: "{ComparisonModel>AmountType}",
value: "{ComparisonModel>AmountSum}",
color: {
path: 'ComparisonModel>AmountSum',
formatter: function(v) {
if (v > 2000) {
return "Critical";
} else{
return "Good";
}
return parseInt(v);
}
}
})
Regards,
Sai Vellanki.
Please check this example code. It may be useful : JS Bin - Collaborative JavaScript Debugging
Kindly let me know if you need any more information
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shahid,
Have you used a comparison chart?
If so you could bind the value
<GenericTile
header=""
subheader=""
size="S"
press="press">
<tileContent>
<TileContent">
<content>
<ComparisonChart size="S" scale="M">
<data>
<ComparisonData title="Override" value="{value}" color="Critical"/>
</data>
</ComparisonChart>
</content>
</TileContent>
</tileContent>
</GenericTile>
Regards,
Naren L Naik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.