Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Adding ICON in column header

Hi,

I am showing a table binded with oData model.

I want to show an ICON on column header along with description.

How can i Do that?

I am using below code to create and add columns

var oTable = new sap.ui.table.Table({
id: "tableId",
width : "1550px",
columnHeaderHeight : 1,
selectionBehavior:sap.ui.table.SelectionBehavior.Row,
visibleRowCount : 20,
});
oTable.addColumn(new sap.ui.table.Column({
name : "RequestId",
width : "100px",
filterProperty : "RequestId",
label : "Request Id",
template : new sap.ui.commons.TextField()
.bindProperty("value", "RequestId")
}));
replied

Just add

sap.ui.table.Column({
name : "RequestId",
width : "100px",
filterProperty : "RequestId",
label : new sap.ui.commons.Label({text : "RequestId",icon : "sap-icon://taxi"});
template : new sap.ui.commons.TextField()
.bindProperty("value", "RequestId")

}));

sap.ui.commons.Label has a icon property with it

JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.commons.Label

3 View this answer in context
Not what you were looking for? View more on this topic or Ask a question