Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147374 | Sep 8,2019 08:30 AM UTC | Sep 24,2019 06:13 PM UTC | Angular - EJ 2 | 7 |
![]() |
Tags: InPlaceEditor |
<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;
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.