|
<ejs-grid
#normalgrid
id="Normalgrid"
[dataSource]="data"
allowPaging="true"
[pageSettings]="pageSettings"
[editSettings]="editSettings"
[toolbar]="toolbar"
>
<e-columns>
<e-column
field="OrderID"
headerText="Order ID"
width="140"
textAlign="Right"
isPrimaryKey="true"
[validationRules]="orderidrules"
></e-column>
……………
<e-column field="Verified"
headerText="Verified"
[allowEditing]="true"
editType="booleanedit"
width="100"
>
<ng-template #template let-data>
<ejs-checkbox
[checked]="data.Verified"
(change)="checkboxChange($event, data)"
></ejs-checkbox> </ng-template>
</e-column> </e-columns>
</ejs-grid>
--------------------------------------------------------------------------
[app.component.ts] // checkbox change function public checkboxChange(args: any, data): void { data[data.column.field] = args.checked; // checkbox value
this.grid.updateRow(args.event.target.closest('tr').rowIndex, data); // update the checkbox change value to the dataSource by passing current rowIndex and updated data to the updateRow method
} |
Hi Team,
Is There any plan for multiple checkbox column without template
Hi Nagendra,
Thanks for contacting Syncfusion support.
By default, the EJ2 Grid edits only one record at a time and can’t edit multiple rows at a time. We can edit a row by double-clicking it or executing the editRecord programmatically. So, the Grid will create a form to edit a row. Since this is the architecture of EJ2 Grid editing.
So, it is not feasible to render the multiple columns with editable state at the initial render.
By
setting the columns.editType as “booleanedit”, Grid
renders the CheckBox component to edit a column.
Documentation: https://ej2.syncfusion.com/angular/documentation/grid/edit/#cell-edit-type-and-its-params
Regards,
Rajapandiyan S