p-datatable rowIndex for pTemplate editor

UI Components for Angular
Post Reply
mani0608
Posts: 1
Joined: 24 Jan 2017, 09:56

29 Jan 2017, 12:04

Hello,
I am using version 2.0.0-rc.2
I am trying to access the rowIndex value as below,

Code: Select all

<p-column>
<template let-data="rowData" let-i="rowIndex" pTemplate="editor">
</template>
</p-column>
But i am not getting the index value (i) above. Need help!!

tryptophane
Posts: 3
Joined: 19 Jan 2017, 10:13

30 Jan 2017, 16:20

Same problem here. With this code

Code: Select all

    <p-column field="name" header="Name" sortable="true">
      <template let-person="rowData" let-i="rowIndex" pTemplate="body">
        {{i}}
      </template>
    </p-column>
I get "NaN" in all cells...

mdaco
Posts: 1
Joined: 28 Mar 2017, 12:01

28 Mar 2017, 12:09

I have a datatable with an Object list which contains a sublist. The columns represents a reference table.
But sort is not working with this implementation.

----------------------------------------------------------------------------------------------------------------------------------

Ref{
id: string;
labelRef: string;
}

Object1{
id: string;
subList: Object2[];
}

Object2{
id: string;
valSub: string;
ref: Ref;
}

----------------------------------------------------------------------------------------------------------------------------------

<p-column *ngFor="let col of cols;let colIndex=index;" [header]="col.header | translate" >
<template let-data="rowData" pTemplate="body" pTemplate>


<div>{{data.subList[colIndex].valSub}}</div>


</template>

</p-column>

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests