Skip to Content

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

How to use formatter in a table??

Hi experts,

I want to make a field in a table coloured, So please guide me how to use formatter for a table field?

Piece of code that I have used for list formatter is like:

   firstStatus: [
              {
  
   text:"{DeliveryStatus}",
   state:{
   path:"DeliveryStatus",
   formatter: function(id)
                  {
                  if(id == "Shipped")
                  {
                  return "Success"
                  }
                  if(id  == "Not Shipped")
                  {
                  return "Error"
                  }
                  if(id == "In Process")
                  {
                  return "Warning"
                  }
                  }}}
   ]
     
     
           
     

});

replied

Hi,

if you need conditonally format SAPUI5 table you can refer this link,

Coloring Table Cells Conditionally in SAP UI5

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question