Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable #loading overridden template is not always rendered #2547

Closed
NikoGJ opened this issue May 18, 2022 · 2 comments
Closed

DataTable #loading overridden template is not always rendered #2547

NikoGJ opened this issue May 18, 2022 · 2 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@NikoGJ
Copy link
Contributor

NikoGJ commented May 18, 2022

Hi everyone,
I found a what I think it's a bug (unless I misunderstood the loading template documentation of the DataTable)

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110

CodeSandbox Case (Bug Reports)
https://codesandbox.io/s/awesome-sound-optdzm?file=/src/App.vue

Current behavior
When overriding the #loading template of the DataTable, it gets rendered the first time the DataTable gets rendered, but not the following times. Instead, the default loading template gets rendered (which includes an overlay + a spinner).
More globally, after looking at the code, it seems the #loading template is rendered only when there is no row to display in the DataTable

Expected behavior
The #loading template should be rendered and superseed the default loading rendering when it is defined, whatever if there are rows to display or not.

Minimal reproduction of the problem with instructions
https://codesandbox.io/s/awesome-sound-optdzm?file=/src/App.vue
I made a codesandbox where I'm using the paginator feature of the DataTable and switch the loading prop on and off when changing pages. We can see that the custom loading template is rendered on first page loading, but afterwards, when changing pages, it is not rendered anymore.

What is the motivation / use case for changing the behavior?
Mainly about consistency.
One use case (shown in the codebox) is having the loading template customized so to allow loading rows to be cancelled or display a progressbar component instead of a spinner icon.
I have looked for workarounds, using the BlockUI component on top of the DataTable for example, but unfortunately, we cannot customize the BlockUI overlay either (but that will be a RFC for later ^^)

  • Vue version: 3.2.33

  • PrimeVue version: 3.12.16

  • Browser: Not relevant I guess, but tested only on Chrome

I'll try to include a PR with a fix proposal if the issue is indeed qualified as a bug.

@tugcekucukoglu tugcekucukoglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label May 23, 2022
@tugcekucukoglu
Copy link
Member

Hi,

Yes it's a bug. We would be grateful if you create a PR with the possible solution.

@tugcekucukoglu
Copy link
Member

Closes this issue #2571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants