question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Add loading text/slot to data-table

See original GitHub issue

Problem to solve

Currently the data-table shows “No data available” when loading - if a response takes a while, a user might ignore the loading progress bar and assume that there is no data to display and leave the page.

Proposed solution

Being able to change the text via a loading-text property would probably be enough to solve this problem.

Currently adding a no-data slot appears to replace the loading text which is why I suggested possibly adding a loading slot but I think as long as the no-data slot doesn’t replace the proposed loading-text property while it’s loading then a loading slot probably wouldn’t be needed.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
06bcommented, Jan 25, 2020

I’ve tested the following scenarios:

  • When a data table is loading…

    • a default loading message is present.
    • if the loading-text prop is present the data table correctly shows the loading message from the loading-text prop instead of the default loading message.
    • if the no-data-text prop is present but the loading-text prop is not present, the data table correctly shows the default loading message instead of the no-data-text prop.
    • if the loading slot is present, the data table correctly shows the content from the loading slot instead of the default loading message & the loading-text prop. ¯\_(ツ)_/¯ The only use case I could think of where this might happen is if someone copy & pastes from the docs where the loading-text prop is shown and then adds a loading slot and forgets to remove the loading-text prop.
  • When a data table has no data…

    • a default no data message is present.
    • if the no-data-text prop is present the data table correctly shows the text from the no-data-text prop instead of the default no data message.
    • if the loading-text prop is present but the no-data-text prop is not present, the data table correctly shows the default no data message instead of the loading-text prop.
    • if the no-data slot is present, the data table correctly shows the content from the no-data slot instead of the default no data message & the no-data-text prop.
  • When a data table has both the loading and no-data prop or slot…

    • the data table correctly shows the text from the loading-text prop when loading and the text from the no-data-text prop when there is no data.
    • the data table correctly shows the content from the loading-text slot when loading and the content from the no-data slot when there is no data.
    • the data table correctly shows the content from the loading-text slot when loading and the text from the no-data-text prop when there is no data.
    • the data table correctly shows the text from the loading-text prop when loading and the content from the no-data slot when there is no data.
      • Confirmed that the no-data slot does not replace the loading-text prop while loading which is why I created this issue as this wasn’t an expected behavior.

Confirmed & Closed. Good Job Everyone. 👍

2reactions
blalancommented, Aug 27, 2018

Couldn’t you in your no-data slot use a data prop that you update in your data getting function? Like: https://codepen.io/blalan/pen/PdNypE Or Even: https://codepen.io/blalan/pen/xaVyyE

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loading text or icon when data loads. — DataTables forums
Hi, is there any way to add loading icon when data loads in datatable? Because it takes 8 to 10 seconds to load...
Read more >
jQuery DataTables: How to show loading indicator during ...
There are some tricks to show loading indicator when retrieving data via Ajax request using jQuery DataTables. Recommended way to reload ...
Read more >
v-textarea API - Vuetify
name type default #append‑icon string undefined #append‑outer‑icon string undefined #auto‑grow boolean false
Read more >
vuejs/vue - Gitter
I want to write this into the Vue components methods to have access to some variables and Vuex store… delueg.
Read more >
Spine Toolbox Documentation
In the Project dock widget, click on the 'add tool template button' () just below the ... The format for requesting new features...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found