Currently I have an sapui table, where I want to have one single row being a link, all other rows should be textviews. my problem is, that constructing the table is based on columns:
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Berichtsmonat",
hAlign : sap.ui.core.HorizontalAlign.Center,
}),
template : new sap.ui.commons.Link({ // <-- this should only be valid
// for one row, others should be
// new sap.ui.commons.TextView
text : "{Text01}",
press : pressListOpen,
}),
width : '120px',
hAlign : sap.ui.core.HorizontalAlign.Center,
}));
later after defining all columns..
oTable.bindRows("/GetXYZ");
So, I cannot switch this for one single line. How would I do this? is it possible?
I think I have to create the table in another way, but how? Would be very thankful for code examples how to solve the problem or how to construct the table properly for my doing...
One solution is that you define the template as a
HorizontalLayout
. Add additional visibility flags to your existing data model, for example as followingVisibleFlagForText
andVisibleFlagForLink
(VisibleFlagForText == !VisibleFlagForLink) .Then you can update the visibility flags of the data model of your single row to set link visible or textview visible.