Lesson 12: Drag and Drop Widgets in Column Cell Container to display records in Table

441 views

Welcome to Lesson 12 of our SmartUX Demo Application series. This guide will walk you through a series of actions to drag and drop widgets in the column cell container to display records in a table. Each step is carefully outlined to help you efficiently navigate through the process. This guide will take you through different sections of components, widgets and their properties. Follow the engaging instructions below to complete the process and enhance your training functionalities. In the previous lesson, you created a table body and assigned style classes for alignment. Let’s move forward to display records in the table.

Upon successful completion of the specified steps, the result will reflect the desired outcome as shown in the image below:

 

1. Drag and Drop the Label widget for the Event ID Column

  • Now drag and drop the Label widget inside the First Column Container.
  • Click on the gear icon of the Data Mapping properties from the Properties Sheet of Label.
  • This will open a window to Select Data Model.

Drag and Drop the Label widget for the Event ID Column

 

2. Data Mapping for Event_Inforrmation_Event_ID Label Widget

  • Select the “Event_Inforrmation_Event_ID” Edit control Data Model.
  • Click the Save button to map the Data Model.

Data Mapping for Event_Inforrmation_Event_ID Label Widget

 

3. Map Text property with mg.getValue function for Event_ID

  • In the Properties Sheet of the Label, click on the gear icon of the Text property.
  • This will open a window for the Select Mg* Function.
  • In this Text property, you can input the text you desire or get the value of the “Event_Inforrmation_Event_ID” Edit control from Magic xpa using the “mg.getValue” function.
  • This function will fetch value from the Magic xpa control to the Label widget.

Map Text property with mg.getValue function for Event_ID

 

4. Map Text property with mg.getValue function for Event_Inforrmation_Event_ID

  • Select the Data Mapping Radio button at the “Select Mg* Function” window.
  • Expand the “Event_Inforrmation_Event_ID” Edit control.
  • Select the “mg.getValue” function and click the Save button.

Map Text property with mg.getValue function for Event_Inforrmation_Event_ID

 

5. Mark the Label widget for Event ID as “Inside Table”

  • Now the Text is mapped with mg.getValue function for Event ID.
  • Select the Checkbox of the property “Is Inside Table”.
  • This property will add [rowId]=”row.rowId” to the Label HTML tag to identify it is inside the Table.

Mark the Label widget for Event ID as “Inside Table”

 

6. Drag and Drop the Label widget for the Event Type Column

  • Follow the same steps as you did for the previous step but for the next columns.
  • Now drag and drop the Label widget inside the Container of the second column “Event Type”.
  • Click on the gear icon of the Data Mapping property from the Properties Sheet of Label.
  • This will open a window to Select Data Model.

Drag and Drop the Label widget for Event Type Column

7. Data Mapping for Event_Inforrmation_Event_Type Label Widget

  • Select the “Event_Inforrmation_Event_Type” Edit control Data Model.
  • Click the Save button to map the Data Model.

Data Mapping for Event_Inforrmation_Event_Type Label Widget

 

8. Map Text property with mg.getValue function for Event_Inforrmation_Event_Type

  • In the Properties Sheet of the Label, click on the gear icon of the Text property.
  • This will open a window for the Select Mg* Function.
  • In this Text property, you can either input the text you desire or you can get the value of the “Event Type” Edit control from Magic xpa using the “mg.getValue” function.
  • This function will fetch value from the Magic xpa control to the Label widget.

Map Text property with mg.getValue function for Event_Inforrmation_Event_Type

 

9. Select mg.getValue function for Event_Inforrmation_Event_Type

  • Select the Data Mapping Radio button at the “Select Mg* Function” window.
  • Expand the “Event_Inforrmation_Event_Type” Edit control.
  • Select the “mg.getValue” function and click the Save button.

Select mg.getValue function for Event_Inforrmation_Event_Type

 

10. Mark the Label widget for the Event Type as “Inside Table”

  • Now the Text is mapped with mg.getValue function for “Event_Inforrmation_Event_Type”.
  • Select the Checkbox of the property “Is Inside Table”.
  • This property will add [rowId]=”row.rowId” to the Label HTML tag to identify it is inside the Table.

Mark the Label widget for the Event Type as “Inside Table”

 

11. Drag and Drop the Label widget for the Event Name Column

  • Follow the similar steps as you did for the previous step but for the next columns.
  • Now drag and drop the Label widget inside the container of the third column “Event Name”.
  • Click on the gear icon of the Data Mapping property from the Properties Sheet of Label.
  • This will open a window to Select Data Model.

Drag and Drop the Label widget for the Event Name Column

 

12. Data Mapping for Event_Inforrmation_Event_Name Label Widget

  • Select the “Event_Inforrmation_Event_Name” Edit control Data Model.
  • Click the Save button to map the Data Model.

Data Mapping for Event_Inforrmation_Event_Name Label Widget

 

13. Map Text property with mg.getValue function for Event Name

  • In the Properties Sheet of the Label, click on the gear icon of the Text property.
  • This will open a window for the Select Mg* Function.
  • In this Text property, you can either input the text you desire or you can get the value of the “Event_Inforrmation_Event_Name” Edit control from Magic xpa using the “mg.getValue” function.
  • This function will fetch value from the Magic xpa control to the Label widget.

Map Text property with mg.getValue function for Event Name

 

14. Select mg.getValue function for Event_Inforrmation_Event_Name

  • Select the Data Mapping Radio button at the “Select Mg* Function” window.
  • Expand the “Event_Inforrmation_Event_Name” Edit control.
  • Select the “mg.getValue” function and click the Save button.

Select mg.getValue function for Event_Inforrmation_Event_Name

 

15. Mark the Label widget for the Event Name as “Inside Table”

  • Now the Text is mapped with mg.getValue function for “Event Name”.
  • Select the Checkbox of the property “Is Inside Table”.
  • This property will add [rowId]=”row.rowId” to the Label HTML tag to identify it is inside the Table.

Mark the Label widget for the Event Name as “Inside Table”

 

16. Drag and Drop the Label widget for the Event Location Column

  • Follow the similar steps as you did for the previous step but for the next columns.
  • Now drag and drop the Label widget inside the container of the fourth column “Event Location”.
  • Click on the gear icon of the Data Mapping property from the Properties Sheet of Label.
  • This will open a window to Select Data Model.

Drag and Drop the Label widget for the Event Location Column

 

17. Data Mapping for Event_Location Label Widget

  • Select the “Event_Location” Edit control Data Model.
  • Click the Save button to map the Data Model.

Data Mapping for Event_Location Label Widget

 

18. Map Text property with mg.getValue function for Event Location

  • In the Properties Sheet of the Label, click on the gear icon of the Text property.
  • This will open a window for the Select Mg* Function.
  • In this Text property, you can either input the text you desire or you can get the value of the “Event_Location” Edit control from Magic xpa using the “mg.getValue” function.
  • This function will fetch value from the Magic xpa control to the Label widget.

Map Text property with mg.getValue function for Event Location

 

19. Select mg.getValue function for Event_Location

  • Select the Data Mapping Radio button at the “Select Mg* Function” window.
  • Expand the “Event_Location” Edit control.
  • Select the “mg.getValue” function and click the Save button.

Select mg.getValue function for Event_Location

 

20. Mark the Label widget for the Event Location as “Inside Table”

  • Now the Text is mapped with mg.getValue function for “Event Location”.
  • Select the Checkbox of the property “Is Inside Table”.
  • This property will add [rowId]=”row.rowId” to the Label HTML tag to identify it is inside the Table.

Mark the Label widget for the Event Location as “Inside Table”

 

21. Drag and Drop the Label widget for the Start Date Column

  • Follow the similar steps as you did for the previous step but for the next columns.
  • Now drag and drop the Label widget inside the container of the fifth column “Start Date”.
  • Click on the gear icon of the Data Mapping property from the Properties Sheet of Label.
  • This will open a window to Select Data Model.

Drag and Drop the Label widget for the Start Date Column

 

22. Data Mapping for Event_Inforrmation_Start_Date Label Widget

  • Select the “Event_Inforrmation_Start_Date” Edit control Data Model.
  • Click the Save button to map the Data Model.

Data Mapping for Event_Inforrmation_Start_Date Label Widget

 

23. Map Text property with mg.getValue function for Start Date

  • In the Properties Sheet of the Label, click on the gear icon of the Text property.
  • This will open a window for the Select Mg* Function.
  • In this Text property, you can either input the text you desire or you can get the value of the “Event_Inforrmation_Start_Date” Edit control from Magic xpa using the “mg.getValue” function.
  • This function will fetch value from the Magic xpa control to the Label widget.

Map Text property with mg.getValue function for Start Date

 

24. Select mg.getValue function for Event_Inforrmation_Start_Date

  • Select the Data Mapping Radio button at the “Select Mg* Function” window.
  • Expand the “Event_Inforrmation_Start_Date” Edit control.
  • Select the “mg.getValue” function and click the Save button.

Select mg.getValue function for Event_Inforrmation_Start_Date

 

25. Mark the Label widget for the Start Date as “Inside Table”

  • Now the Text is mapped with mg.getValue function for “Start Date”.
  • Select the Checkbox of the property “Is Inside Table”.
  • This property will add [rowId]=”row.rowId” to the Label HTML tag to identify it is inside the Table.

Mark the Label widget for the Start Date as “Inside Table”

 

26. Mg* Function of Start Date Label

  • In the Highlighted HTML tag, you will see the Mg* function:
    • “{{ mg.getValue(mgc.Event_Inforrmation_Start_Date,row.rowId) }}”
  • Park before the closing curly braces of the function.

Mg* Function of Start Date Label

 

27. Add DatePipe after Mg* Function for Start Date

  • DatePipe is an essential feature in Angular that allows you to format dates according to locale rules.
  • It is beneficial when you need to display dates in a human-readable format within your application.
  • Let’s modify the Mg* Function.
  • Currently, the Mg* Function is as follows:
    • {{ mg.getValue(mgc.Event_Inforrmation_Start_Date,row.rowId) }}
  • Add DatePipe to the Mg* function as follows:
    • {{ mg.getValue(mgc.Event_Inforrmation_Start_Date,row.rowId)|date:’dd/MM/YYYY’ }}
  • Once you add DatePipe you will observe the Start Date is formatted and now in a readable format.
  • The entire expression retrieves a date value from the specified component, and then the date filter formats it into the desired date format (day/month/year).
  • For example, if the original date value is “2024-04-15,” the output would be “15/04/2024.”

Add DatePipe after Mg* Function for Start Date

 

28. Drag and Drop the Label widget for the End Date Column

  • Follow the similar steps as you did for the previous step but for the next columns.
  • Now drag and drop the Label widget inside the container of the fifth column “End Date”.
  • Click on the gear icon of the Data Mapping property from the Properties Sheet of Label.
  • This will open a window to Select Data Model.

Drag and Drop the Label widget for the End Date Column

 

29. Data Mapping for End Date Label Widget

  • Select the “Event_Inforrmation_End_Date” Edit control Data Model.
  • Click the Save button to map the Data Model.

Data Mapping for End Date Label Widget

 

30. Map Text property with mg.getValue function for End Date

  • In the Properties Sheet of the Label, click on the gear icon of the Text property.
  • This will open a window for the Select Mg* Function.
  • In this Text property, you can either input the text you desire or you can get the value of the “Event_Inforrmation_End_Date” Edit control from Magic xpa using the “mg.getValue” function.
  • This function will fetch value from the Magic xpa control to the Label widget.

Map Text property with mg.getValue function for End Date

 

31. Select mg.getValue function for Event_Inforrmation_End_Date

  • Select the Data Mapping Radio button at the “Select Mg* Function” window.
  • Expand the “Event_Inforrmation_End_Date” Edit control.
  • Select the “mg.getValue” function and click the Save button.

Select mg.getValue function for Event_Inforrmation_End_Date

 

32. Mark the Label widget for the End Date as “Inside Table”

  • Now the Text is mapped with mg.getValue function for “End Date”.
  • Select the Checkbox of the property “Is Inside Table”.
  • This property will add [rowId]=”row.rowId” to the Label HTML tag to identify it is inside the Table.

Mark the Label widget for the End Date as “Inside Table”

 

33. Mg* Function of End Date Label

  • In the Highlighted HTML tag, you will see the Mg* function:
    • “{{ mg.getValue(mgc.Event_Inforrmation_End_Date,row.rowId) }}”
  • Park before the closing curly braces of the function.

Mg* Function of End Date Label

 

34. Add DatePipe after Mg* Function for End Date

  • DatePipe is an essential feature in Angular that allows you to format dates according to locale rules.
  • It is beneficial when you need to display dates in a human-readable format within your application.
  • Let’s modify the Mg* Function.
  • Currently, the Mg* Function is as follows:
    • {{ mg.getValue(mgc.Event_Inforrmation_End_Date,row.rowId) }}
  • Add DatePipe to the Mg* function as follows:
    • {{ mg.getValue(mgc.Event_Inforrmation_End_Date,row.rowId)|date:’dd/MM/YYYY’ }}
  • Once you add DatePipe you will observe the Start Date is formatted and now in a readable format.
  • The entire expression retrieves a date value from the specified component, and then the date filter formats it into the desired date format (day/month/year).
  • For example, if the original date value is “2024-04-15,” the output would be “15/04/2024.”

Add DatePipe after Mg* Function for End Date

 

35. Drag and Drop the Button widget for the Action Column

  • Drag and drop the Button widget for modify operation, inside the container of the seventh column “Action”.
  • Click on the gear icon of the Data Mapping property from the Properties Sheet of the Button.
  • This will open a window to Select Data Model.

Drag and Drop the Button widget for the Action Column

 

36. Data Mapping for Modify Action Button Widget

  • Select the “btn_Modify” Button to control the Data Model.
  • Click the Save button to map the Data Model.

Data Mapping for Modify Action Button Widget

 

37. Set Modify operation button widget Properties

  • Select the Checkbox of the property “Is Inside Table”.
  • This property will add [rowId]=”row.rowId” to the Button HTML tag to identify it is inside the Table.
  • In the Labels & Icons section remove the Button Text from the Label property.
  • In the Style Override section input the Class property as “editbtn”.

Set Modify operation button widget Properties

 

38. Drag and Drop another button widget for the Action Column

  • Drag and drop another Button widget for the Delete operation, inside the container of the seventh column “Action”.
  • Click on the gear icon of the Data Mapping property from the Properties Sheet of the Button.
  • This will open a window to Select Data Model.

Drag and Drop another button widget for the Action Column

 

39. Data Mapping for Delete Action Button Widget

  • Select the “btn_Delete” Button control from the Data Model.
  • Click the Save button to map the Data Model.

Data Mapping for Delete Action Button Widget

 

40. Set Delete operation button widget Properties

  • Select the Checkbox of the property “Is Inside Table”.
  • This property will add [rowId]=”row.rowId” to the Button HTML tag to identify it is inside the Table.
  • In the Labels & Icons section remove the Button Text from the Label property.
  • In the Style Override section input the Class property as “deletebtn”.
  • Save the component changes by clicking Save in the top right corner.
  • Disable the View Code and Expanded View.

Set Delete operation button widget Properties

 

41. Event List Table with Records

  • Now you can see the records from the Event List table.
  • These records will also be visible in design mode in Canvas as the SmartUX Studio is a WYSIWYG Studio.
  • Here the Start Date and End Date Column display the Date in a different format.
  • We will refine the Start Date and End Date Columns in the next Lesson.
  • Also, we have dropped a Subform on the Canvas, we will add a display condition for the Card and the Subform widget.

Event List Table with Records

 

The guide covered the process of dragging and dropping widgets in a column cell container to showcase records in a table, ensuring a seamless experience in managing and displaying data within the application. Mastering the process of Drag and Drop Widgets in Column Cell Container to display records in a Table. Simply follow the engaging instructions provided and enhance your workflow effortlessly.

Share this Article

Lesson 12: Drag and Drop Widgets in Column Cell Container to display records in Table

Or copy link

CONTENTS