Hi
I need to show row index number on my Datatable widget to provide an excel like experience for my users. Is there any easy way to accomplish this task?
thanks...
Row number in Datatable
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
It is passes as rowIndex;
Code: Select all
<p-column header="Index">
<template let-i="rowIndex">
{{i}}
</template>
</p-column>
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Good to hear!
Hi, after I updated the primeng, the rowIndex does not work and it display NaN in the datatable.
My code is written like this:
My code is written like this:
Code: Select all
<p-column field="" header="#" [style]="{width:'5%','text-align':'left'}">
<template let-i="absRowIndex" pTemplate="body">
{{i+1}}
</template>
</p-column>
I see that you use instead of maybe that should correct your problem ?
Code: Select all
let-i="absRowIndex"
Code: Select all
let-i="rowIndex"
-
- Information
-
Who is online
Users browsing this forum: No registered users and 21 guests