Advanced SAPUI5 Part-30: the Grid Table Advanced Features

We gained knowledge of row actions as well as the freezing of columns and rows. I’ll go over the grid table’s characteristics below in this blog article.

  • row highlighter
  • swap out the row colors

Highlighter for Rows

A row highlighter is a vertical color band that is used to indicate a row’s start with a certain color, such as red for an error, yellow for a warning, green for a success, etc. In a technical sense, the grid table’s row Settings Template aggregate has to be implemented. The row Settings Template is where.


XML View coding

We have the Row Settings property named highlight set to the O Data service‘s Fax attribute. Please see the grid table topic for information on starting from scratch when building a UI control for a grid table. The aforementioned code is based on that post’s code. The value of the Fax attribute is not kept for some of the records in the OData service’s output. As a result, the formatter function used in the code above will return SUCCESS for entries for which fax is retained and ERROR for records of this type.


Controller coding: formatter function logic

The formatter function has been defined in the controller to return the correct value for the RowSettings highlight property. This is the code.

setHighLight:function(sProperty)
		{
			var highLightVal = '';
			if((sProperty === null) || (sProperty === ''))
			{
				highLightVal = sap.ui.core.MessageType.Error;
			}
			else
			{
				highLightVal = sap.ui.core.MessageType.Success;
			}
			return highLightVal;
		},

View the Row Highlighter in operation.

When you run the application, you will notice that rows will be highlighted in red and green depending on whether the Model’s Fax property is available.

Different Row Coloring

Up until now, every row has had the same background color—white. A characteristic of a grid table allows the rows to be alternately colored on a light grey background. To do this, set

The magic is accomplished by setting this property to true. Save the view code now, then launch the application once more. You’ll notice that the colors have been applied to alternate rows.

Please do the actions outlined in this blog article. In the comments box, please leave any questions, comments, or criticism. I will gladly reply as soon as possible.


you may be intereseted in this blog:-

Create and Configure Automation

Unleash the Power of Your Salesforce Inspector Extension

MASTER YOUR PRODUCT JOURNEY WITH SAP PLM (2024 GUIDE)

Elevating Data Interoperability: Exploring OData Implementations and Libraries

  • Related Posts

    BAPI_ALM_ORDER_MAINTAIN terminates with the runtime error MESSAGE_TYPE_X

    Let’s know BAPI_ALM_ORDER_MAINTAIN terminates with the runtime error MESSAGE_TYPE_X in depth. Assuming that you experience a runtime dump with MESSAGE_TYPE_X (CO 888) while referring to BAPI as “BAPI_ALM_ORDER_MAINTAIN”, then, at…

    Sales Office Data … Can you change it even if config does not allow?

    Your business needs to change/right the Business Office information, regardless of whether it isn’t permitted in standard change mode in exchange IW32. See the screen capture, it is incapacitated. Sales…

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You Missed

    BAPI_ALM_ORDER_MAINTAIN terminates with the runtime error MESSAGE_TYPE_X

    • By Varad
    • April 16, 2025
    • 13 views
    BAPI_ALM_ORDER_MAINTAIN terminates with the runtime error MESSAGE_TYPE_X

    Sales Office Data … Can you change it even if config does not allow?

    • By Varad
    • April 15, 2025
    • 22 views
    Sales Office Data … Can you change it even if config does not allow?

    PO re-price issue in BAPI_PO_CHANGE

    • By Varad
    • April 14, 2025
    • 28 views
    PO re-price issue in BAPI_PO_CHANGE

    Efficient way to retrieve Open Sales Order using FM SD_SELECT_SALES_DOCUMENTS

    • By Varad
    • April 13, 2025
    • 34 views
    Efficient way to retrieve Open Sales Order using FM SD_SELECT_SALES_DOCUMENTS

    ISU – 6 – Bankruptcy Overview and Write-Off Process using BAPI_CTRACDOCUMENT_WRITEOFF

    • By Varad
    • April 12, 2025
    • 32 views
    ISU – 6 – Bankruptcy Overview and Write-Off Process using BAPI_CTRACDOCUMENT_WRITEOFF

    Get Latitude and Longitude of any place using Google Map API in SAP

    • By Varad
    • April 11, 2025
    • 31 views
    Get Latitude and Longitude of any place using Google Map API in SAP