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

Index in data component #1497

Closed
ar53n opened this issue Dec 5, 2016 · 6 comments
Closed

Index in data component #1497

ar53n opened this issue Dec 5, 2016 · 6 comments

Comments

@ar53n
Copy link

ar53n commented Dec 5, 2016

I'm submitting a ... (check one with "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
Can not get index in template repeat.

<template ngFor let-race [ngForOf]="races" let-i="index" [ngForTrackBy]="trackByFn"> <div class="ui-grid ui-grid-responsive ui-fluid" style="font-size:16px;padding:20px;border-bottom:1px solid #D5D5D5;"> <div class="ui-grid-row" style="font-size:14px"> <div class="ui-grid-col-3 ui-g-sm-6 md-6 lg-6"> <div class="ui-grid ui-grid-responsive ui-fluid"> <div class="ui-grid-row">{{race?.name}} {{i}}</div> <div class="ui-grid-row">{{i}}</div> </div> </div>

Expected behavior

Minimal reproduction of the problem with instructions

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

Please tell us about your environment:

  • Angular version: 2.0.X
  • PrimeNG version: 2.0.X
  • 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 ]
  • Language: [all | TypeScript 2.0 | ES6/7 | ES5]

  • Node (for AoT issues): node --version = 6.9.1

@upmauro
Copy link
Contributor

upmauro commented Dec 7, 2016

Not have problems in framework. Please check your code.

Change let-i="index" to let-i="rowIndex" seems solve your problem.

I created plnkr with the examle of this case working:

http://plnkr.co/edit/ZjXzfR4EIpxXPJ4jmLaA?p=preview

@ar53n
Copy link
Author

ar53n commented Dec 7, 2016

@upmauro its work for dataGrid, but not dataList. Have any case for this?

@upmauro
Copy link
Contributor

upmauro commented Dec 7, 2016

Huuum, i need time to think how we can solve it.

In dataList component the template is created by pTemplateWrapper inside a ngFor (where we have index). I don't know how we can inject this value inside pTemplateWrapper.

https://github.com/primefaces/primeng/blob/master/components/datalist/datalist.ts#L20-L22

@cagataycivici you have ideia how to solve it?
(sorry mention, but i'm very curious how solve it)

@ar53n
Copy link
Author

ar53n commented Dec 8, 2016

@ar53n
Copy link
Author

ar53n commented Dec 8, 2016

@upmauro sorry for incorrect pull request, but i solved this problem.
#1532 #1531 .
But index show how rowIndex

@sudheerj
Copy link
Contributor

This issue is already fixed here #1539
So closing the issue now.

cetincakiroglu added a commit that referenced this issue Mar 13, 2024
Fixed #1497 - Chip | Add aria-label to remove icon
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

3 participants