<ejs-inplaceeditor [url]='url' adaptor="UrlAdaptor" name='User' primaryKey="1" (actionBegin)="onBegin($event)"></ejs-inplaceeditor> |
onBegin(args: ActionBeginEventArgs) {
args.data.value = 'Andrew - Employee';
} |
onBegin(args: ActionBeginEventArgs) {
args.data.name = 'Andrew John';
args.data.value = 'Andrew - Employee';
args.data.primaryKey = 5;
args.data['custom'] = 'Syncfusion Custom Data';
}
|
[app.component.html]
<ejs-grid #grid [dataSource]='data' allowPaging='true' showColumnChooser='true'(dataBound)='ondatabound($event)' [toolbar]="toolbar" [pageSettings]='pageSettings'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right'></e-column>
<e-column field='CustomerName' headerText='Customer Name' width='150'></e-column>
<e-column field='OrderDate' headerText='Order Date' width='130' format="yMd"textAlign='Right'></e-column>
<e-column field='Freight' headerText='Freight' width='120' format='C2'textAlign='Right'></e-column>
<e-column field='ShippedDate' headerText='Shipped Date' width='130' format="yMd"textAlign='Right'></e-column>
<e-column field='ShipCountry' headerText='Ship Country' width='150'></e-column>
<e-column field='ShipCity' headerText='Ship City' width='150'></e-column>
</e-columns>
</ejs-grid>
----------------------------------------------------------------------------------------------------
[app.component.ts]
export class AppComponent {
public data: Object[];
@ViewChild('grid', { static: true })
public grid: GridComponent;
@ViewChild('custombutton', { static: true })
public custombutton: any;
public columns: string[] | Column[] | ColumnModel[] = [];
public toolbar: string[];
ngOnInit(): void {
this.data = data;
this.toolbar = ['ColumnChooser'];
}
ondatabound(): void {
let button = document.createElement('button');
button.innerText = "Save";
this.grid.element.querySelector('.e-ccdlg .e-footer-content')['append'](button);
}
} |
// Grid’s actionBegin event function
public OnActionBegin(args: SortEventArgs) {
// Check if the sort operation is being performed
if (args.requestType === "sorting") {
// Cancel the operation
args.cancel = true;
}
} |