Okay
  Public Ticket #2782892
Filter Function Question
Closed

Comments

  • Dave Bloom started the conversation

    Hi - Is there a date range filter option to only show rows that have TODAY'S date? This would be so this could auto-update each day. Also, how would the responsiveness work if different days the table displays different numbers of rows?
    Thanks!

  • [deleted] replied

    Hi Dave

    Thank you for reaching out to us.

    You can use a placeholder to filter the results that match today's date, by adding this placeholder in the column's settings, filtering tab %CURRENT_DATE%

    5338138844.png

    The responsiveness function will still act the same and displayed the filtered results.

    Do let us know if you need any further assistance.

  • Dave Bloom replied

    Thanks! I suppose I should have been more specific. Can I have it match not to the full date but just month and day, ignoring year? I can have a column that shows month and day like MM/DD in my dataset, but can I have it only show rows that have a MM/DD equal to today's MM/DD?

  • Dave Bloom replied

    And also - can I hide all filter controls from the published site? 

  • [deleted] replied

    Hi Dave

    To be honest, I don't think this is possible, not with the plugin's builtin features at least, but I have forwarded it to our developers to take a look. If they have an example of a custom solution I will forward it straight over to you.

    When it comes to hiding the filters you can simply disable the Advanced column filters option from the Sorting and filtering tab in the table settings.

    7759309100.png
  • [deleted] replied

    Hi Dave

    Here are a few suggestions you can try regarding the table's dynamic filter: 

    You can create an SQL query like this

    SELECT *
    FROM table_name
    WHERE table_name.`name_of_column_that_contain_date` = CURDATE()
    

    Like this only rows with current date will be shown .

    You can also filter the table with Conditional formatting for that column where is available %TODAY% placeholder. You have to set rules like this where you will set two rules one that is less than %TODAY%  and second that is greater than %TODAY% and set row class for example hide(like in the example)

    1917975943.png

    Then you have to make that class in  Custom wpDataTables CSS under the "Custom JS AND CSS" in the main settings of wpdatatables.

    table.wpDataTable tr.hide {
    display:none !important;
    }
    

    I hope this helps, do let me know if you need any further assistance.