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 still propagating endless onLazyLoad events - previous case #1434 #1502

Closed
davisruk opened this issue Dec 5, 2016 · 8 comments
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@davisruk
Copy link

davisruk commented Dec 5, 2016

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/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.

http://plnkr.co/edit/NtWWnN

Current behavior

Same as #1434 which was marked as fixed for 1.0.1. A Datatable with lazyLoad=true and a filter with a value propagates endless onLazyLoad events when the Datatable's underlying data array is altered e.g. items added or removed. The problem is in the ngDoCheck function where the lazyLoad check still calls the filter function:
if (this.hasFilter()) { if (this.lazy) { //prevent loop if (this.stopFilterPropagation) this.stopFilterPropagation = false; else this.filter(); } else { this.filter(); }
Expected behavior

The component should create one onLazyLoad event. Removing the call to this.filter within the lazyLoad check fixes the problem.
if (this.hasFilter()) { if (this.lazy) { //prevent loop if (this.stopFilterPropagation) this.stopFilterPropagation = false; //else //this.filter(); } else { this.filter(); }
Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

See previous case (#1434)
Please tell us about your environment:

See previous case (#1434)

  • Angular version: 2.0.X

See previous case (#1434)

  • PrimeNG version: 2.0.X

1.0.1

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

See previous case (#1434)

@no0dles
Copy link

no0dles commented Dec 15, 2016

same issue here, lazy loading and filters are enabled.

Without a filter value everything works fine, but after setting a filter value it loads the filtered content once and as soon as you try to navigate to the second page the loop begins. It also resets the "first" value to 0.

@crimpphantom
Copy link

I have add an example for this issue: http://plnkr.co/edit/3643a4

@cagataycivici cagataycivici added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Jan 5, 2017
@cagataycivici cagataycivici added this to the 2.0 milestone Jan 5, 2017
@cagataycivici cagataycivici self-assigned this Jan 5, 2017
@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Jan 11, 2017
@cagataycivici
Copy link
Member

Fix checked in.

@shajeeck
Copy link

Filter on primeng datatable with lazy load is looping the lazyload! Any help?

primeng - 4.0.0 RC 2
Angular - 4.0.0

@shalaby
Copy link

shalaby commented Apr 17, 2017

@cagataycivici same here as @shajeeck

@shalaby
Copy link

shalaby commented Apr 18, 2017

but when enabling immutable mode on the table the problem is solved :) #2044

@ghost
Copy link

ghost commented May 10, 2017

With [immutable]="true" the event it's called twice.
Please fix this issue.

Thanks

@cagataycivici
Copy link
Member

cagataycivici commented May 12, 2017

[immutable] is removed in 4.0, please see the blog post for details.

https://www.primefaces.org/primeng-4-0-0-rc4-released/

We've received feedback that this is fixed with 4.0 as well.

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

6 participants