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

Error after edit or add #1

Closed
thehulk58 opened this issue Feb 26, 2018 · 4 comments
Closed

Error after edit or add #1

thehulk58 opened this issue Feb 26, 2018 · 4 comments

Comments

@thehulk58
Copy link

Right after when we update or add new item, it gives error "
Cannot read property 'id' of undefined
at eval (masters.designationcrud.component.ts:187)
at Array.filter ()
at MapSubscriber.eval [as project] (masters.designationcrud.component.ts:184)
at MapSubscriber._next (map.js:79)
at MapSubscriber.Subscriber.next (Subscriber.js:92)
at MergeMapSubscriber.notifyNext (mergeMap.js:151)
at InnerSubscriber._next (InnerSubscriber.js:25)
at InnerSubscriber.Subscriber.next (Subscriber.js:92)
at BehaviorSubject.Subject.next (Subject.js:56)
at BehaviorSubject.next (BehaviorSubject.js:46)
"

code line-
return Observable.merge(...displaydataChangeDesignation).map(() => {
//Filter data
this.filteredData = this._exampleDatabase.dataDesignation.slice().filter((designation: IDesignation) => {
const searchStr = (designation.id + designation.designationName ).toString().toLowerCase();// this line gives error
return searchStr.indexOf(this.filter.toLowerCase()) !== -1;
});

   if we click reload data button then it binds newly added/updated value. I think the grid is loading data too fast before it gets data from the server and find nothing.Please suggest how can I correct this issue.
@marinantonio
Copy link
Owner

So If I get this right, your dataServices works fine, DB query passes but you have a problem with the frontend update? Does delete work? Well, looking at your error you have an issue with the ID. My best guess is that you're not passing ID correctly from dialog. Try assigning constant value to the ID and observe results.

@marinantonio marinantonio self-assigned this Feb 26, 2018
@marinantonio marinantonio added the good first issue Good for newcomers label Feb 26, 2018
@marinantonio marinantonio removed their assignment Mar 28, 2018
@marinantonio marinantonio removed the good first issue Good for newcomers label Mar 28, 2018
@ramziakkari
Copy link

Do you have solution for this please? i have the same error

@marinantonio
Copy link
Owner

Same thing I wrote above. Please check your ID.

@vardhan2507
Copy link

#3 (comment)

Check this.... This is working like Pro!!! After searching a lot, finally found this fix.

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

4 participants