cancel
Showing results for 
Search instead for 
Did you mean: 

Applyling a class to Sap.m.table row dynamically...

former_member239819
Participant
0 Kudos

I I'm trying to assign a class to a row in my sap.m.table dynamically using my view model SearchResults.


Unfortunately it's igoring my class properties (see below).


How do I do this in my XML view ?


<items class="{SearchResults>typeClass}">
  <ColumnListItem class="{SearchResults>typeClass}">
  <cells>
  <ObjectIdentifier title="{ path:'SearchResults>temporaryDate', formatter:'.formatDisplayDate'}"/>


  <TimePicker id="TP1_1" value="{SearchResults>startTime1}" selectedKey="{SearchResults>startTime1}"  valueFormat="HH:mm" displayFormat="HH:mm" change="onTimeChangedOpening"
   visible="{SearchResults>isOpen}" valueState="{SearchResults>startTimeValid}"
   placeholder="Enter Opening Time"  editable="false">
  </TimePicker>

Accepted Solutions (0)

Answers (2)

Answers (2)

junwu
Active Contributor
0 Kudos

go the chrome to check what happened to your css.

1. is class added in right place?

2. is the class overwritten by some other css?

jamie_cawley
Advisor
Advisor
0 Kudos

Both items and ColumnListItem do not have a property called class.  You could probably do it in the controller using addStyleClass.

Regards,

Jamie

SAP - Technology RIG

jamie_cawley
Advisor
Advisor
0 Kudos

Maybe this would help you too...

Regards,

Jamie

SAP - Technology RIG

former_member239819
Participant
0 Kudos

Many thanks Jamie, the link had the solution I was after.

Regards

Adam