HI:
I can't implement a simple selection with igx-select control on grid column that returns the key value (numeric) with a selection of text .
like data = {id:1, city:'buenos aires'},{ id:2, city: 'la plata', ....}
can you help me?
Pablo
Hello,
I have been looking into your question and created a sample application in order to demonstrate how such behavior could be achieved. As you can notice in the attached sample, I have retemplated the igxCell of the City column in order to add an igxSelect with described structure:
<igx-column field="City" header="City" [dataType]="'string'" width="25%" [editable]="true" [resizable]="true"> <ng-template igxCell let-cell="cell"> <igx-select [(ngModel)]="cell.value" #select style="width:100"> <igx-select-item *ngFor="let item of selectData" [value]="item.city" > {{item.id}}: {{item.city}} </igx-select-item> </igx-select> </ng-template> </igx-column>
Here you can find my sample for your reference.
However, please keep in mind that the grid data in the City column contains only the city's name and in case of sorting, for example, the values of this column would be sorted depending on the city (not the id).
Additionally, if you need a select only when editing a cell in this column you could retemlate the igxCellEditor instead of IgxCell.
Let me know if I may be of any further assistance.
Sincerely,
Teodosia Hristodorova
Associate Software Developer
He Teodosia
Sorry, but your example dont WORK!!
First, i dont need that cell be editable, i only need select from dropdown.
second: i dont need show id on selection, only text (simply select from key, value)
third and more important:: after select from dropdown the city no is assigned to datasource from grid!!!!
so that I would need to choose the city if then the data is not assigned?? ja ja I dont bealive!!
Sorry, but you test this example before send me?
I