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

v2-table scroll issue #11

Closed
marcelobcortes opened this issue May 13, 2018 · 7 comments
Closed

v2-table scroll issue #11

marcelobcortes opened this issue May 13, 2018 · 7 comments

Comments

@marcelobcortes
Copy link

marcelobcortes commented May 13, 2018

Hi there!

I'm facing a problem with table's scroll.
The mentioned table is inside a b-modal (bootstrap vue)
I'm using a fixed height enough to display 3 rows
If I scroll all it down to see the 5#,6#,7# row and then switch to other modal containing <= 3 rows
these 3 rows arent displayed. But i can scroll up back and see those rows

https://hastebin.com/zamuxovowo.xml

@dwqs
Copy link
Owner

dwqs commented May 13, 2018

Which version do you use? And can show me a case or more code? @marcelobcortes

@marcelobcortes
Copy link
Author

marcelobcortes commented May 16, 2018

Hello!
https://github.com/marcelobcortes/teste-fullstack

teste-fullstack/resources/assets/js/components/alunos.vue

(if you can I would love to receive feedback about the whole project code)

@dwqs
Copy link
Owner

dwqs commented May 16, 2018

@marcelobcortes I have seen your code and I want to know how to switch to other modal ?

@marcelobcortes
Copy link
Author

marcelobcortes commented May 16, 2018

click in a entry in "alunos" sections.
shows up "aluno" data and a v2-table.
v2-table was configured to show 3 entries... so find a "aluno" with more than 3 entries (if you find easier, change alunocertificadofactory to create more entries) and scroll all it down and close
after that, click in another entry and you will see that v2-table scroll's position did not get reseted despite of the data got refreshed

let me know if I still wasnt clear enough

@dwqs
Copy link
Owner

dwqs commented May 17, 2018

@marcelobcortes I have reproduced it. And I will fix it as soon as possible. Thanks for your feedback.

@dwqs dwqs closed this as completed in 2bc7828 May 17, 2018
@dwqs
Copy link
Owner

dwqs commented May 17, 2018

<v2-table v-if="cursos.length>0" height=132 :data="cursos" ref="table">
    <v2-table-column width=20 label="#" prop="sequence"></v2-table-column>
    <v2-table-column label="Curso" prop="nome"></v2-table-column>
    <v2-table-column label="Data de matrícula" prop="datamatricula"></v2-table-column> 
    <v2-table-column label="Data de conclusão" prop="dataconclusao"></v2-table-column>  
    <v2-table-column label="Nota" prop="nota"></v2-table-column>  
</v2-table>

When cursos is updated, you can reset the scrollbar via calling updateScrollbar method of table:

this.cursos = new-cursos-data
this.$refs.table.updateScrollbar(true);

@marcelobcortes You need to upgrade v2-table to v3.0.1. Hope it helps you.

@sknightq
Copy link

sknightq commented Aug 1, 2018

@dwqs I think put the update scroll function in v2-table component rather than exposed outside because sometimes the table DOM's render doesn't finish, but I have invoked the update scroll function.
like following snippets:

watch: {
  rows(newRows, oldRows) {
     this.$refs.table.updateScrollbar(true);
    // At this moment, my table is still old
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants