Ask AI
Skip to main content

Clear rows of datatable

Function: Clear rows of datatable

This function allows you to quickly remove all entries or records from a specific data table component on your application's page. It's useful when you need to reset a table, clear old data, or prepare it for new information.

Input

  • Datatable
    • Description: This is the visual table component on your application's page from which you want to remove all rows. You'll select the specific data table you intend to clear.
    • Type: UI Element (specifically a Data Table)

Output

This function does not produce a direct output value. Instead, it modifies the selected Datatable by removing all its rows.

Execution Flow

Real-Life Examples

  • Example 1: Resetting a Shopping Cart

    • Inputs:
      • Datatable: Shopping Cart Items (the data table displaying items in a user's cart)
    • Result: After a customer successfully places an order, all items are removed from the Shopping Cart Items table, making it ready for their next shopping session.
  • Example 2: Clearing a Temporary Log

    • Inputs:
      • Datatable: Session Activity Log (a table used to temporarily log user actions during a session)
    • Result: At the beginning of a new user session, the Session Activity Log table is completely emptied, ensuring that only current session activities are recorded.
  • Example 3: Refreshing Search Results

    • Inputs:
      • Datatable: Product Search Results (a table displaying products based on a user's search query)
    • Result: When a user enters a new search term, the Product Search Results table is cleared of previous results before new results are loaded, providing a clean view for the new search.