We're Moving to a New Support Platform – Starting June 1st!

We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.

You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.

While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.

We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.

Thanks for your continued support and trust – we’re excited to bring you an even better support experience!

Okay
  Public Ticket #3811605
Filter issues
Closed

Comments

  • Jim started the conversation

    Subject: Assistance Needed: Filtering wpDataTables Using Date, User Role, and User ID

    Dear wpDataTables Support Team,

    We have been working on implementing dynamic filtering for a table in wpDataTables, but we’ve encountered significant challenges. Here's a summary of our requirements and the issues we’re facing:

    Setup Details:

    • The table in question is based on an SQL query.
    • The table is displayed using wpDataTables (ID: 7).
    • We need to filter the data dynamically using:
      1. A date range (start_date and end_date).
      2. The logged-in user’s role.
      3. The logged-in user’s ID.

    What We’ve Tried:

    1. Using the URL parameters approach (e.g., adding ?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD to filter).
      • While this partially works for simple filters, it’s not integrating well with the dynamic date range and user-specific parameters.
    2. JavaScript for frontend filtering.
      • We tried applying filters via JavaScript by targeting the wpDataTable instance, but it didn’t seem to trigger or reload the filtered data as expected.
    3. Hook-based server-side filtering.
      • We attempted using hooks such as wpdatatables_filter_data_before_display, but there were inconsistencies in passing dynamic data like user role or ID, especially for date ranges selected on the frontend.

    Current Situation: The table renders correctly, but:

    • The dynamic date range filter doesn’t work as expected.
    • User role and ID-based filtering are not applied consistently.
    • We’re unsure of the best method to implement a robust solution that combines these three filtering parameters.

    Our Goal: We need a clear and efficient way to:

    1. Dynamically filter the table based on a date range selected on the frontend (via dropdown or date picker).
    2. Apply server-side filters to ensure that data is displayed according to the logged-in user’s role and user ID.
    3. Combine these filters seamlessly so the table updates correctly without requiring a page reload.

    Could you please guide us on how to achieve this? If there’s a recommended method, example code, or best practice for such scenarios, we would appreciate your help.

    Thank you for your assistance!

    Best regards, Mr Jim

  •   Miloš replied privately