• Resolved graemebryson5

    (@graemebryson5)


    Hey Tobias,

    For some context prior to my question; I’m generating multiple tables based on a user’s choice from a <select> input (which contains a list of company names). On submission of that form, I’m generating tables for that company using the row filtering extension.

    Sometimes, one of the tables won’t contain any rows/results for that specific company – is there any way to show a default ‘No results found’ message for those instances, rather than displaying the table headers with no rows below?

    Appreciate it’s a pretty niche question, but I’d be massively grateful for any advice/options.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I see what you mean, but unfortunately, I can not offer a directly usable solution. Your best chance here probably is to use one of the available filter hooks, like tablepress_table_output (see the code). There, you could check if the output contains only one row and if the filter parameter was set in the Shortcode. If both is true, the filter result was empty and you could replace the one row with a custom message.

    Regards,
    Tobias

    Thread Starter graemebryson5

    (@graemebryson5)

    Thanks Tobias – that’s a huge help. I’ll try to post a snippet here for anyone else in the future.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    great! That would be nice!

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display message if no rows found’ is closed to new replies.