<div class="control-section">
<ejs-grid class="sortingenabled" [dataSource]='data' allowPaging='true' allowSorting='true' [pageSettings]='pageSettings' (actionBegin)='actionBegin($event)'>
<e-columns>
...
</e-columns>
</ejs-grid>
</div> |
...
export class AppComponent {
...
actionBegin(args: any): void {
if(args.requestType == "sorting"){
console.log("Column Name: "+ args.columnName); //getting sorting column name
console.log("Sorting Direction: "+ args.direction); //getting sort direction
args.cancel = true; //prevent sorting action
}
}
} |