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

DataView component CANNOT find any results from @Input data passed from parent component #14106

Closed
anof1r opened this issue Nov 14, 2023 · 4 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@anof1r
Copy link

anof1r commented Nov 14, 2023

Describe the bug

I'm trying to pass data from the parent component to a child that contains a DataView. Unfortunately, the DataView showing the "No results found" message and cannot render passed data under no circumstances.

Environment

Windows 10

Reproducer

https://stackblitz.com/edit/angular-pa3wff?file=demo%2Fsecond%2Fsecond.component.html

Angular version

16.2.0

PrimeNG version

16.1.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

17.4.0

Browser(s)

Chrome

Steps to reproduce the behavior

  1. Pass any data to the child component that contains DataView
  2. Bind it <p-dataView [value]="your array of object">
  3. See the result

https://stackblitz.com/edit/angular-pa3wff?file=demo%2Fsecond%2Fsecond.component.html
Here you can see that the first component passes the data Array to its child, but DataView doesn't render it

Expected behavior

<p-dataView> component renders all the necessary data from @Input() decorator, like <p-table> does

@anof1r anof1r added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 14, 2023
@ashikjs
Copy link
Contributor

ashikjs commented Nov 14, 2023

@anof1r here is workable solution,
https://stackblitz.com/edit/angular-tnean4?file=src%2Fapp%2Fdemo%2Fsecond%2Fsecond.component.html

btw: you did mistake two one you call Grid layout but used itemlist template and you did not call rows.

@anof1r anof1r changed the title DataView component CANOT find any results from @Input data passed from parent component DataView component CANNOT find any results from @Input data passed from parent component Nov 14, 2023
@anof1r
Copy link
Author

anof1r commented Nov 14, 2023

Hi @ashikjs, thanks for your response.
Your solution works as expected, but I really need to pass data through @Input()
I've changed layout and pTemplate properties locally and in Reproducer. Nothing changed, still no data in DataView.
If it can help, checkout my local approach here - https://github.com/anof1r/language-quizz/blob/dev/anof1r/src/app/words-list/words-list.component.html

@ashikjs
Copy link
Contributor

ashikjs commented Nov 14, 2023

@anof1r can you check it? I can see here everything expected.

https://stackblitz.com/edit/angular-usbl6e?file=src%2Fapp%2Fdemo%2Fsecond%2Fsecond.component.ts

@anof1r
Copy link
Author

anof1r commented Nov 14, 2023

Gosh :( my bad. Just found the logic error in my parent component. Everything works fine now. Thanks for help @ashikjs !

@anof1r anof1r closed this as completed Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants