Hi, I provide training in SAP UI5. Also feel free to checkout my new web page https://saptechblog.com
Webdynpro ABAP

Table with sorting functionality



In this tutorial we are going to add sorting functionality to the table.

One way of doing this is create an event handler method for sort event of table UI element and in that event handler method get the data from context node, and identify the column chosen for sort and sort the data accordingly and set it back to the context node.

But I prefer using the sorting functionality provided by the table UI itself. All you need is to create an event handler method for sort event in Table.  

In that event handler method get the reference of the table and its table handle. Using the table handler trigger the method apply sort for triggering the sorting.

I have constructed a simple application to display the data in the form of table. The output of the application is as below.  Let’s go ahead and start adding the sorting functionality to the table.

Output:
clip_image002[6]


Create an event handler method for the sort event of the table UI element.
clip_image003[6]


Write the following code in the event handler method.

clip_image004[6]

Activate and execute the application:

Output:
Table can be sorted by any columns.
clip_image006[6]

About Arun

1 Comments:




  1. Business Analytics Certification Course Overview
    The Professional Certification in Business Analytics is a foundation course for students and professionals who want to develop niche data skills for their chosen industry domain or function area. Become a Business Intelligence and Data Visualisation expert and surge ahead in your career. The nine-day Business Analytics certification course covers all the essential Analytical and Statistical techniques for effective business decision making. This programme introduces the student to the basic concepts of Python language. Data Science training in hyderabad

    ReplyDelete

Powered by Blogger.