Okay
  Public Ticket #3663174
No data in table availble
Closed

Comments

  •  1
    Michael started the conversation

    Hi Team

    as a suggestion: It would be meaningful to set a specific text per table if the table is empty (class: dataTables_empty).

    e.g. I checked some inputs with SQL and the text can be: 'no issues detected' instead of 'no data in the table available'


    Best Regards Michael

  •  1,846
    Miloš replied

    Hi Michael,

    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

    Right now the line is 547,  but since we often update the plugin, the line might change in the future,

    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

    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 devise an image that has text on it,

    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 helps.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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