Hello, I have the following scenario:
The column status is represented in the following code:
<kendo-grid-column [headerStyle]="{'font-weight': 'bold'}" [width]="200" field="status" title="Status">
<ng-template kendoGridCellTemplate let-dataItem>
<span class="whole-cell" [style.backgroundColor]="colorCode(dataItem.status.description)">
<kendo-combobox [data]="statuses" textField="description" valueField="code" [filterable]="true"
(filterChange)="handleFilter($event)" [(ngModel)]="dataItem.status">
</kendo-combobox>
</span>
</ng-template>
</kendo-grid-column>
When I click in the blue part, the grid run the following code:
public cellClickHandler({ sender, rowIndex, columnIndex, dataItem, isEdited }) {
if (!isEdited) {
sender.editCell(rowIndex, columnIndex, this.createFormGroup(dataItem));
}
public createFormGroup(dataItem: any): FormGroup {
return this.formBuilder.group({
orderNumber: dataItem.orderNumber,
status: [dataItem.status, Validators.required],
customerDateWanted: dataItem.customerDateWanted,
providerShipDate: dataItem.providerShipDate,
boxesCount: dataItem.boxesCount,
providerCode: dataItem.providerCode,
brand: dataItem.brand,
postharvest: dataItem.postharvest,
boxType: dataItem.boxType,
bunchesUnitPerBox: dataItem.bunchesUnitPerBox,
flowerCost: dataItem.flowerCost,
observation: dataItem.observation,
slots: dataItem.slots,
flowerCode: dataItem.flowerCode,
flowerGrade: dataItem.flowerGrade,
composition: dataItem.composition,
pricesB: dataItem.pricesB
});
}
I have a doubt about the isEdited field because always is false, when is true?
In the next link you can see the problem with the component:
https://www.loom.com/share/8bf170aefde14cafa44e6250ab6d7b76
dataItem.status is an object like {value:1, description:"PROCESS"}
Which is my problem ?
Thanks!