I have one row with two columns as grid view to populate the date from the sevrver. By view everything is fine. But say i have 2 row with 4 column.like below :
a b
c d
So i have a click function on my row where selected item can see as detail view page.But the issues here is .For example if i select first grid cell in first row. that is ‘A’.Then in detail page its showing all the details about ‘A’
Same if i select ‘B’ then also in detail screen its showing as ‘A’ grid cell data only.Which is showing all the data about ‘A’.
Things i tried :
print the function of on click .if i select “A” then A is showing.If i select “B” then also on selected click function “A” Data only showing.
Here is my code :
<ion-grid no-padding>
<ion-row no-padding *ngFor="let item of Data;let i=index" (click)="showDetails(item)">
<ng-container *ngIf="i % 2 == 0">
<ion-col col-6 col-sm-3 col-md-6 col-lg-4 col-xl-3 *ngIf="i < Data.length">
<ion-card no-margin>
<div gallery-title>
<h2 item-title text-wrap text-center>{{Data[i].ProductName}}</h2>
</div>
</ion-card>
</ion-col>
<ion-col col-6 col-sm-3 col-md-6 col-lg-4 col-xl-3 *ngIf="i+1 < Data.length">
<ion-card no-margin>
<div gallery-title>
<h2 item-title text-wrap text-center>{{Data[i+1].ProductName}}</h2>
</div>
</ion-card>
</ion-col>
</ng-container>
</ion-row>
</ion-grid>
Any help.I don't know what i am doing wrong here.
Thanks in advance !!