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

nodata when reset rows[] object #136

Closed
elvisbegovic opened this issue Sep 21, 2016 · 15 comments
Closed

nodata when reset rows[] object #136

elvisbegovic opened this issue Sep 21, 2016 · 15 comments

Comments

@elvisbegovic
Copy link
Contributor

BUG:
This component works well when no scroll but when I scroll and change rows[] data with ajax call no data are displayed, here you are: click this gif
error when change data

The is one for all tab, I juste reset rows data. How can achieve this bug ? Is there better way to update datarows or?

FACULTATIF: you can see when waiting data I set rows=[]empty and I have header and emptyMessage "No data to display" instead of nothing... I don't think I can use something like style display:hide when rows.length==0

@amcdnl
Copy link
Contributor

amcdnl commented Sep 21, 2016

Can you build a demo w/ plunkr?

@elvisbegovic
Copy link
Contributor Author

elvisbegovic commented Sep 21, 2016

I can't, I have so many module but I have only one datatable tag and his rows[] is different... but when scrolling it wont works with another rows[] update ... very strange

when I reset rows[] how can I reset height too

@amcdnl
Copy link
Contributor

amcdnl commented Sep 21, 2016

I'm sorry w/o a demo, I won't be able to help.

@amcdnl amcdnl closed this as completed Sep 21, 2016
@elvisbegovic
Copy link
Contributor Author

elvisbegovic commented Sep 22, 2016

@amcdnl hmm? Close my issue like this isn't cool. this takes me 2hours to find how to reproduce but here you are: http://plnkr.co/edit/k7JBaZottJUhtOdgfW1P?p=preview your help is welcome ! so when you click
a) Get data 1
b) Get data 2
c) Get data 1
IT WORKS!

The problem is when you click Get data 1 (scroll a little bit down...) THEN click Get data 2 => SURPRISE ! No data or data aren't reset if you were scrolled before

FACULTATIF: do you have idea how can I hide header and emptyMessage "No data ti display" when waiting data from server...

@amcdnl
Copy link
Contributor

amcdnl commented Sep 22, 2016

Awesome, I will check it out today!

Sorry, I closed it but without proper reproduction I can't make a fix ;).

@amcdnl amcdnl reopened this Sep 22, 2016
@nthonymiller
Copy link
Contributor

I noticed same issue while trying to get around https://github.com/swimlane/angular2-data-table/issues/127

I was delaying the the setting of the rows object bound to the datatable in ngAfterViewInit() to see if this worked, but it didn't I got message 'No data Loaded'.

@amcdnl
Copy link
Contributor

amcdnl commented Sep 28, 2016

Is this resolved by the other PR?

@elvisbegovic
Copy link
Contributor Author

elvisbegovic commented Sep 29, 2016

@amcdnl I posted a plunker, do you checked it ? http://plnkr.co/edit/k7JBaZottJUhtOdgfW1P?p=preview

The problem is always here on my plunker with last RP.

1.

But today I have another problem: you can check it here on my GIF, you will see the content of the table is fill only until middle ... not completly... maybe because of "display:none" nefore data is available.... the problem is here:
MIDDLE EMPTY PROBLEM:
datatable-middle-empty

2.

Another things or ENHANCEMENT please put the scroll bar in TOP:0 when we change data... you can see on this next gif that if I scroll bottom and change TAB so the scrollbar keep same position instead of going TOP !!! Paging is always same ... how fix this ?

SCROLLBAR PROBLEM:
datatable-scrollbar

@amcdnl
Copy link
Contributor

amcdnl commented Sep 29, 2016

Ya, agreed I think it should reset scrollbar position to the top on a re-sort.

@elvisbegovic
Copy link
Contributor Author

elvisbegovic commented Sep 29, 2016

@amcdnl What do you mean "re-sort" Because I just reset data I don't sort them on clicking on column, I think the scrollbar need go position to top when this is changing: [rows]='dataFiles'

And what you think about my first problem called MIDDLE EMPTY PROBLEM ?

@amcdnl
Copy link
Contributor

amcdnl commented Sep 29, 2016

Fixed the sort not updating scrollbar in 0.7.4, See if that fixes this plz.

@elvisbegovic
Copy link
Contributor Author

@amcdnl my friend please apologize but not fixed! I have one more same question do you checked my demo here http://plnkr.co/edit/k7JBaZottJUhtOdgfW1P?p=preview
You can see the problem with these step:
The problem is when you click Get data 1 (scroll a little bit down...) THEN click Get data 2 => SURPRISE ! No data or data aren't reset on GET DATA 2 and whenyou go back to GET DATA 1 it still empty

@amcdnl
Copy link
Contributor

amcdnl commented Nov 29, 2016

Is this still happening?

@elvisbegovic
Copy link
Contributor Author

donno can't retry now but will close it and reopen it if still happen, thanks

@Tazzmanian
Copy link

Tazzmanian commented Jun 15, 2018

it still happens. if i show 10 rows per page and go on page 2, then change the table.bodyHeight (table height via css) the scroll is at top but first 10 rows space is blank and the second part is visible. It shows the data on scroll down, because scroll up is not possible. If it is done from page 1 there is no such problem.
Found a solution bodyComponent.offsetY = 0;. If not temp list have the second half and the indexes are wrong instead 0-21 they are 10-31.

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

No branches or pull requests

4 participants