My requirement is when i select specific row and clicked on ExportData cutomize button present in toolbxx then i want to call actionBegin event.
when i select specific row and click on toolbar custom export button then i want to call actionBegin event
when i select specific row based on rowid then if i click on toolbar customized button then i want to file in json format
|
// Grid’s toolbarClick event handler
toolbarClick(args: ClickEventArgs): void {
if(args.item.text === "PDF Export") {
// Retrieves selected record JSON data
var selectedRecords = this.grid.getSelectedRecords();
if (selectedRecords.length !== 0) {
// The selected record data is set to the export’s dataSource property and passed along with the pdfExport method
let exportProperties = {
dataSource: selectedRecords,
};
this.grid.pdfExport(exportProperties);
} else {
// If no records are selected, then the entire data is exported
this.grid.pdfExport();
}
} else if (args.item.text === "Excel Export") {
// The same approach can be used for excel export
}
} |