Hi,
I tried to access the properties of the class on click event of the custom button in grid. but it is not accessible. can anybody help me out.
The code segment what I have written is mentioned below.
Also let me know how to bind the click event and data with the custom button in grid using rowDataBound event and how would it be fire on button click.
Regards,
Nirbhay
<div>
<ej-grid id="Grid" [dataSource]="gridData" [editSettings]="editSettings" (rowDataBound)="rowDataBound($event)"
(endDelete)="deleteRole($event)" (endAdd)="addRole($event)"
(endEdit)="editRoleGrid($event)">
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign="right" isPrimaryKey='true' >e-column>
<e-column field='CustomerID' headerText='Customer ID' width='120' textAlign="right" >e-column>
<e-column field='Freight' headerText='Freight' width='120' format='C2' textAlign="right" >e-column>
<e-column field='ShipName' headerText='Ship Name' width='170'>e-column>
<e-column field='ShipCountry' headerText='Ship Country' width='150'>e-column>
<e-column field='Status' headerText='status' width='150'>e-column>
<e-column headerText='Manage Records' width='160' [commands]='buttons'>e-column>
e-columns>
ej-grid>
div>
this.editSettings = { allowEditing: true };
this.buttons = [{ type: "edit", buttonOptions: { cssClass: "glyphicon glyphicon-pencil" } },
{ type: "delete", buttonOptions: { cssClass: "glyphicon glyphicon-trash" } },
{ type: "save", buttonOptions: { cssClass: 'glyphicon glyphicon-penci' } },
{ type: "cancel", buttonOptions: { cssClass: 'fa fa-file-text-o' } },
{
type: "details", buttonOptions: {
text: "member",
click: this.onClick(event)
}
}];
}
onClick(e) {alert("onClick");
console.log("onClic");
}