4D Blog

Home Tips Create an Interactive List of Data with 4D Qodly Pro

Create an Interactive List of Data with 4D Qodly Pro

March 20, 2025

Tips

In this week’s blog, we explore the creation of a dynamic page for displaying data. We will focus on a practical application: building a system to generate annual performance reports for employees. This project is available for reference on GitHub.

Our aim is to design a user-friendly interface that displays a list of employees with options to filter results by department and employment status.

Performance Review Application

Here’s the final result:

Setting Up Qodly Sources

In the Qodly Sources section, we will define the different sources used by our components.

In this example, we are creating a source titled “Employees”, of type entity selection, based on the data class “Employee”. The initial value is set to all employees.

blank

Note:

  • Sources grouped under “This.page” have a limited scope to the current page. Use these for temporary or page-specific data handling.
  • Sources grouped under “Namespaces” have a global scope, making them suitable for data or settings shared across multiple pages.

Creating a Datatable

With 4D Qodly Pro, you can utilize datatable or matrix components to effectively present a list of data. In this example, we use the datatable component, similar to the listbox of type Collection or Entity Selection in 4D.

The “Qodly source” field allows you to assign an entity selection to populate the datatable. The “Selected Element” field retrieves the selected entity, which is equivalent to the “Current item” in the listbox.

blank

Then, in the “Columns” section, we can add columns and define their expressions. For instance, we define a column for “Firstname”, which is a direct attribute of the “Employee” dataclass, and “Department.Name”, which is a related attribute.

blank

Filtering Data

In this implementation, the list of employees can be filtered based on their department or their active employee status.

blank

Function loadEmployees()

On the 4D side, we add a function in the “Employee” class to return an entity selection according to filtering criteria.

Here’s a code snippet:

exposed Function loadEmployees($departement : Object; $isActive : Boolean) :  cs.EmployeeSelection
 If ($departement#Null)
   return This.query("ID_Departement = :1 AND isActive = :2"; $departement.ID; $isActive)
 Else
  return This.query("isActive = :1"; $isActive)
 End if

 

Filter by Active Status

To implement filtering by employment status, we create a Qodly source of type boolean named “isActive”, then we set the initial value to true. Next, we add a checkbox linked to this source.

blank

To achieve a switch-like appearance, we will set the “Variant” property to Switch.

blank

Then, the “loadEmployees” function is associated with the “On Change” event of the checkbox.

blank

Find further details on events in the Qodly Events Documentation.

Filter by Department

To filter by department, we use a selectBox similar to a dropdown in 4D.

We create two data sources:

  • “departments” of type entity selection
  • “department” of type entity

 

Then, we add a selectBox component by setting “departments” as the Qodly source and “department” as the selected element.

blank

Next, inside the selectBox, we insert a text component linked to the source “$This.Name”.

blank

Finally, on the “On Change” event of the SelectBox component, we call the “loadEmployees” function with the parameters “department” and “year”.

blank

Voilà!

blank

Styling datatable

The final step is to adapt the datatable to match your company’s design guidelines or your application’s visual identity. You can either customize it:

  • by adjusting the widget’s properties, such as colors, borders, and other styles,
  • or apply a CSS class.

Using a CSS class offers the advantage of maintaining a consistent style across all Datatables in your application, ensuring a cohesive user experience.

In an upcoming blog post, we will explore the various possibilities of using CSS in Qodly Studio. If you can’t wait, the CSS class used in the Performance Review application is called “DataTable”.

Next Steps

Congratulations! You now have a functional page capable of displaying and filtering employee data. This interactive system provides a strong foundation for dynamic data handling in Qodly applications.

To further enhance your understanding of datatables and their actions, explore the following resources:

  • Documentation on the datable component, 
  • Documentation of the action, 
  • Watch our video on datatables.

 

Happy coding, and see you in the next blog!

Discuss

Tags 20 R8, 21, 4D Qodly Pro, Data table, Performance Review Application, Qodly Studio, Tutorial

Latest related posts

  • September 15, 2025

    Find the right spot in your 4D Write Pro document with AI

  • September 2, 2025

    Intelligent 4D Write Pro document analysis with AI

  • August 25, 2025

    ORDA – Constructor and touched event – Detailed behaviour through a network

Vanessa Talbot
Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy