Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9182

Re: How to add multiple button in a column of a table in sapui5?

$
0
0

Hi,

 

You can't add a layout to the text property of a textfield, so this won't work.

 

A better approach would be something like this:

 

oTable.addColumn(new sap.ui.table.Column({  label: new sap.ui.commons.Label({text: "Confirmation"}),  template: new sap.ui.layout.HorizontalLayout({    content : [      new sap.ui.commons.TextView({        text: "Confirmed",        textAlign: sap.ui.core.TextAlign.Left,        visible : ...      }),      new sap.ui.commons.Button({        text : Approve,        press : doApprove,        visible : ...      }),      new sap.ui.commons.Button({        text : "Reject",        press : doReject,        visible : ...      })    ]  })
}));

Simply place all needed elements inside the layout, and based on the 'visible' property, you either show both buttons, or the textview.

 

I'll leave it as an exercise to you on how you should actually handle the visible state for the TextView and Buttons (hint: use model binding)


Viewing all articles
Browse latest Browse all 9182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>