BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
App.component.html
<ejs-grid #grid [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [filterSettings]='filteringSettings' allowFiltering='true' (actionBegin)="onActionBegin($event)" (actionComplete)="onActionComplete($event)" [query]="query">
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right'></e-column>
<e-column field='CustomerID' headerText='Customer ID' width='160'></e-column>
<e-column field='EmployeeID' headerText='Employee ID' width='120' textAlign='Right'></e-column>
<e-column field='Freight' headerText='Freight' width='150' format="C2" textAlign='Right'></e-column>
<e-column field='ShipCountry' headerText='Ship Country' width='150' ></e-column>
</e-columns>
</ejs-grid>
App.component.ts
export class AppComponent {
public query: Query = new Query();
@ViewChild('grid')
public grid: GridComponent;
ngOnInit(): void {
this.data = new DataManager({ url: SERVICE_URI + 'api/Orders', adaptor: new WebApiAdaptor });
this.pageSettings = { pageCount: 3 };
}
public onActionBegin(args) {
}
public onActionComplete(args) {
if (args.requestType == 'filterafteropen') {
args.filterModel.sInput.onkeypress = this.addfilterParams.bind(this); // binding onKeyPress event for searchBox
}
}
public addfilterParams (args) {
this.query = new Query();
this.query.addParams("where" + args.currentTarget.value, args.currentTarget.value);
this.grid.query = this.query;
console.log(args, this.query)
}
}
|
App.component.html
<ejs-grid #grid [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [filterSettings]='filteringSettings' allowFiltering='true' (actionBegin)="onActionBegin($event)" (actionComplete)="onActionComplete($event)" [query]="query">
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right'></e-column>
<e-column field='CustomerID' headerText='Customer ID' width='160'></e-column>
<e-column field='EmployeeID' headerText='Employee ID' width='120' textAlign='Right'></e-column>
<e-column field='Freight' headerText='Freight' width='150' format="C2" textAlign='Right'></e-column>
<e-column field='ShipCountry' headerText='Ship Country' width='150' ></e-column>
</e-columns>
</ejs-grid>
App.component.ts
export class AppComponent {
public data: DataManager;
public pageSettings: Object;
public filteringSettings = { type: 'Excel' };
public query: Query;
@ViewChild('grid')
public grid: GridComponent;
ngOnInit(): void {
this.data = new DataManager({ url: SERVICE_URI + 'api/Orders', adaptor: new WebApiAdaptor });
this.pageSettings = { pageCount: 3 };
}
public onActionBegin(args) {
}
public onActionComplete(args) {
if (args.requestType == 'filterafteropen') {
args.filterModel.sInput.onkeyup = this.addfilterParams.bind(this); // binding onkeyup event for searchBox
}
}
public addfilterParams (args) {
this.grid.query.addParams("where" + args.currentTarget.value, args.currentTarget.value);
console.log(args, 'Query: ', this.grid.query.params, args.currentTarget.value);
}
} |