Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141866 | Jan 8,2019 10:35 PM UTC | Jan 10,2019 11:19 AM UTC | React - EJ 2 | 1 |
![]() |
Tags: Grid |
export class Exporting extends SampleBase {
pdfExpComplete = (args) => {
//This event will be triggered when pdf exporting.
args.promise.then((e) => {
//In this `then` function, we can get blob data through the arguments after promise resolved.
var blobURL = URL.createObjectURL(e.blobData);
window.open(blobURL);
});
};
toolbarClick(args) {
switch (args.item.text) {
case 'PDF Export':
// pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob)
// if ‘isBlob’ is set as true then it will return blob data
this.gridInstance.pdfExport(null, null, null, true);
break;
}
}
render() {
return (<div className='control-pane'>
<div className='control-section'>
<GridComponent dataSource={orderDetails} ref={grid => this.gridInstance = grid} toolbar={this.toolbarOptions} allowPaging={true} allowExcelExport={true} allowPdfExport={true} toolbarClick={this.toolbarClick.bind(this)} pdfExportComplete={this.pdfExpComplete.bind(this)}>
<ColumnsDirective>
. . .
</ColumnsDirective>
<Inject services={[Page, Toolbar, ExcelExport, PdfExport, Group]} />
</GridComponent>
</div>
</div>);
}
}
render(<Exporting />, document.getElementById('sample')); |
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.