Customize the default "No data to display" alert message

Comments

6 comments

  • Avatar
    Brandon Carraway

    I followed the above guide, and I still see the default error message - Is there something I need to put in my Google Sheet?

    0
    Comment actions Permalink
  • Avatar
    Thomas Morin

    Hello Brandon,

    Actually, this method doesn't work when you apply filter and no data are displayed.

    This method works only when:

    • you have no data in your Google Spreadsheet data source
    • you have no data because of the query you used

    So, it can not work in your example.

    Thank you for your understanding.

    Thomas

    0
    Comment actions Permalink
  • Avatar
    Ayhan G

    Hello Brandon,

    That was something I was looking for until I found the solution like this:

    At the Template page use the following code under <script> column:

    /* Custom error message */

    .at-noData-icon:before {
    content: "No data matching that criteria";
    color: red;
    font-weight: bold;
    text-align: left;
    }

    .at-noData-message {display:none!important}

    /* Custom error message */

     

    You can customize the error message (No data matching that criteria) at the second line.

    1
    Comment actions Permalink
  • Avatar
    Eumir AMC

    Hi Ayhan G, thank you so much for your solution. Is there any opposite way to display a text if a match is found, not showing the actual search?

     

    That is, I'm looking for the text ABCDE, if found, it will say: "found", othewise, "No data matching...". I've accomplished the latter but not the situation if found.

    0
    Comment actions Permalink
  • Avatar
    Ayhan G

    Hi Eumir AMC,

    I don't know any direct method to do this but maybe the topic here might help you about "Display and style elements depending on their value."

    Hope it helps.

    0
    Comment actions Permalink
  • Avatar
    Eumir AMC

    Hola! thank you so much for your article, it is awesome! however, the thing about it is that it requires a specific value to show something, however, that I need is to show something IF the value was found, something like this:

    .status[data-status!=""]:after {
    content : "This task is done ! ";
    color : green
    }

    See that data-status (is not equal) to empty.

     

    thank you

    0
    Comment actions Permalink

Please sign in to leave a comment.