Skip to Content
0
May 18, 2018 at 02:44 PM

How to add colors to new sap.m.Button

132 Views

Hi Guy's,

//IF my status is "B" "BUY" Button should be green if my status is "Q" my  "QUOTE" should be Blue.                    

venderdata: function(sKey) {
var a = this.getView().byId("quantity");
var that = this;
var oTable = this.byId("idTblVendor");
var url = "/VendorData('" + sKey + "')/Results";
var itemTemplate = new sap.m.ColumnListItem({
	cells: [
		new sap.m.Text({
			text: "{VENDOR_NO}"
		}),
		new sap.m.Text({
			text: "{VENDOR_NAME}"
		}),
		new sap.m.Text({
			text: "{PRICE}"
		}),
		new sap.m.Button({
			text: "Quote",
			// type: "Emphasized",
		}),
		new sap.m.Button({
			text: "Buy",
			// type:"Accept",
		}),
		new sap.m.Text({
			text: "{STATUS}"
		})
	]
});
oTable.bindItems({
	path: url,
	template: itemTemplate
});
},

Attachments

capture444.jpg (16.3 kB)