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
Working with ionic? #85
Comments
You must pass a native element as parentScroll. Eg: <div #scrollingBlock>
<virtual-scroll [items]="items"
[parentScroll]="scrollingBlock.nativeElement"
(update)="viewPortItems = $event">
<input type="search">
<div #container>
<list-item *ngFor="let item of viewPortItems" [item]="item">
</list-item>
</div>
</virtual-scroll>
</div> Please check: https://github.com/rintoj/angular2-virtual-scroll#use-scrollbar-of-parent-block |
Thanks for your reply. I tried @ViewChild(Content) content: Content; <virtual-scroll [items]="companies" (update)="viewPortItems = $event" [parentScroll]="content && content._elementRef.nativeElement.querySelector('.scrollContent')"> But all the items are rendered. :( |
it work, thanks (querySelector('.scrollContent') => querySelector('.scroll-content')) @ViewChild(Content)
ionContent; <virtual-scroll [parentScroll]='ionContent?.getScrollElement()' [items]='vehicles|async' >
<vehicle *ngFor='let v of viewPortItems' [instance]='v'></vehicle>
</virtual-scroll> |
Not success work in ionic2
|
Solves!!! |
How did everyone get this to work with Ionic 3? After installation and adding the markup to my view, I can't get past this error: Update: I figured out the issue. I had to import the |
I have the virtual-scroll working in my Ionic Native app, but have encountered the following issue when scrolling on a touch screen device (iOS or Android):
Here is my markup:
Any ideas on how to fix this issue? Update: Adding |
@Avishaidev not working properly when it fetches more data to the list, it cannot display all items in the viewport. |
@rintoj in ionic 3, when used to load more data (end) or (change) event is not fired when scroll reaches end and as a result the function binding the end event is not called. can you please look in to thanks
|
hi @faraazc did you find a solution? |
Anyone tried to use ion-refresher? |
I finally solved the ion-refresher problem. |
The way I got it working for me flawlessly, even with the changing number of elements in the list and images : HTML
CSS
To keep the heights consistent. TSBelow export class After you get the data from SQL or whatever, set the [bufferAmount] of elements in viewPortItems so it renders correctly
Also add this function . Replace 96 with the height of your element ( childHeight was quite buggy with this one )
|
Closing as several users have posted working solutions to the issue. @tonypig93 and @faraazc these appear to be unrelated issues. Please open separate issues if you're still having problems. Thanks. |
Is it working with Ionic3?
I tried but it's rendering all the items instead of only the ones in the content viewport.
Then I tried to pass the Ionic content with:
content variable is defined in my page with
But I got a
Uncaught (in promise): TypeError: parentScroll.addEventListener is not a function
Any ideas?
Someone sucessfully implemented it in Ionic?
The text was updated successfully, but these errors were encountered: