The AppGini Blog
A few tips and tricks to make your coding life a tiny bit better.

Replace 'No matches found' with a custom message

Purpose of this recipe

When using quick search in an AppGini app, and no matches are found, a default alert-warning message is displayed. We want to replace it with some custom HTML message. See the screenshot below.

Files to edit

Add the following code to hooks/tablename-tv.js (where tablename is the name of the concerned table). If the file doesn’t exist, create it.

$j(function() {
   $j('.table_view .alert-warning').replaceWith(
      '<div style="max-width: 90vw; white-space: normal;">This search term was not found!</div>'

In the above code, replace This search term was not found! with the desired HTML code to display.


If you’d like to apply this code to all tables rather than just a specific one, you can add the code to hooks/footer-extras.php instead of hooks/tablename-tv.js. In that case you should add <script> before the code, and </script> after it.