Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add multiple controls in a single table column?

Tags:

sapui5

I have a small issue. I want to add two controls(TextView and Button) in a single table column. I have tried concatenation, array type to pass two controls into template but failed. Anyone please help me to solve this.

this is my sample table.

like image 470
Jag Avatar asked Oct 19 '25 08:10

Jag


1 Answers

You can create more complex column templates like this:

var nameColumnTemplate = new sap.ui.layout.HorizontalLayout({
  content : [new sap.ui.commons.Button({text : "Click"}), new sap.ui.commons.TextView({text : "{lastName}"})]
});

tbl.addColumn(new sap.ui.table.Column({
  label: "Last Name",
  template: nameColumnTemplate
}));

JSBin example.

like image 56
Tim Gerlach Avatar answered Oct 22 '25 04:10

Tim Gerlach



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!