Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #3539303
Do Not Show table on webpage if nothing to show
Closed

Comments

  • Chris started the conversation

    If the SQL comes back empty is there a way to not display anything? I don't want to show anything.  My thought is to allow the user to enter a message with a start and stop date. Be able to display it at the top of the page like an alert bar. 

  • Chris replied

    I may have found a way to make this happen how can I remove "No data available in table"  or change the color of it so you can not see it?

  •  1,693
    Miloš replied




    Hi Chris,

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    -

    1. In regards to your initial question, i am sorry, but at the moment we do not have any 'out of the box' solution to achieve a conditional table load like that, such as allowing the User to try some filter selection, and then depending if the table returns any rows for that filter range or not -  to not load a table at all if it's no rows returned.

    -

    We do have the add-on Powerful Filters, which you can use to first present the User with a filter selection and hide the Table before they make their chose for one or more filters;

    and only then to load the  filtered resulting Table.

     You can optionally add the "search" Button, too.

    - Before purchase, you can test this Add-on's features on our sandbox site.


    2. Displaying an Alert depending on a user's action on a table;

    For that we also don't currently have any built-in solutions.


    3. But if you found some workaround to partially achieve your use-case, and if you now just need to edit hiw the "No data available in table" appears /  or change color, etc;   we have possible workarounds to advise :


    For example, If you simply wish to change the text displayed when there are no rows / matching records found,

    there is a PHP file in the plugin that you can edit with any text/code editor, in this path:

    /wp-content/plugins/wpdatatables/source/class.wdttools.php

    The last time i checked, this piece of the code was on line 547,  but since we often update the plugin, the lines sometimes change over time,

    so it is best to use "Ctrl+F" to search for this string : 'sZeroRecords'  and find this  :

    'sZeroRecords' => __('No matching records found', 'wpdatatables'),
    

    Here is my example :

    1194867840.png

    Then, edit the line inside the brackets, and change it to anything you need,

    in this example "No invoices found", so the line will be

    'sZeroRecords' => __('No invoices found', 'wpdatatables'),
    

    And this is the result, in one of my Test Tables :

    8083652858.png

    Or if you wish to make that text just blank, you can do so - but then, the Table's Columns and appearance will still load, it will just be blank inside where the rows should be, rather than having that text.

    -

    You can also use an image, if you wish.

    We had a user who used an image, instead of the "No matching records found" :

    6408503152.png

    So, if you create an appropriate image for this purpose,

    you can simply add a HTML image tag, with the image source, like this for example :

    'sZeroRecords' => __('<img src="https://yourDomain/wp-content/uploads/2022/01/ImageName.svg">', 'wpdatatables'),

    - Just to note, any time you update the wpDT plugin, it will overwrite the PHP file again; 

    so, you will have to repeat this with the PHP code edit. 


    I hope that might help.

    If you have an idea what we might add in the future as a better solution, you can create a development suggestion.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.


    If you have coding skills and wish to try to make a custom solution now for any point that is currently not available as 'built in',

    you can check out our available hooks for Developers on this documentation and see if you can find any hook that might help.

    Please be advised that custom solutions with hooks are not included in our support.

    You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround.

    ( We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet)

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Chris replied

    Thanks - I did find a workaround and learned a new feature.  I'm good for now and appreciate all the useful information.  As always you are very helpful.

  •  1,693
    Miloš replied

    Hi Chris,

    Just a small follow up.

    I am glad to see you found a workaround for your use-case, thank you for letting us know.

    No problem, i am happy to share any possibly useful details we have on the subject.

    We will, of course, do our best to make improvements in the future that would allow better/easier built-in ways to achieve it.

    As you know, don't hesitate to open new tickets if anything else comes up.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables