on 05-15-2014 11:30 AM
Hi,
I want to keep the same icon and only change the color depending on the status field.
In this way as described below, it definitely does not work. I think I have to use CSS but I have no idea how I can address CSS style. Unfortunately, the method addStyle does not apply to this case.
items: {
path: "/APP_DATA/TRANSDATA",
template: new sap.m.ObjectListItem({
type: "{device>/listItemType}",
press: [oController.handleListItemPress, oController],
intro : "{REPORT_CATEGORY}",
icon : {
path : "STATUS",
formatter : function(myStatus) {
if(myStatus=="CHECKED")
return sap.ui.core.IconPool.getIconURI({
src: "sap-icon://activity-items",
color: "#2DFA06", //green
});
return sap.ui.core.IconPool.getIconURI({
src: "sap-icon://activity-items",
color: "#FC0519", // red
});
);
}
},
Any suggested solution?
Many thanks,
Fouad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
nice solution Dennis!
I've created another version which uses more css and less javascript logic.
I've added some comments, but if you really want to understand whats going on, you should read through the links I've provied within the comments.
Greets,
ben
Hi Fouad,
which color do you want to change?
Greets,
ben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.