<script>
var grid = new ej.grids.Grid({
dataSource: orderData,
allowFiltering: true,
allowPdfExport: true,
filterSettings: { type: 'Excel' },
toolbar: ['PdfExport'],
toolbarClick: function (args) {
if (args.item.text === 'PDF Export') {
let query = grid.renderModule.data.generateQuery(true); // get grid corresponding query
grid.getDataModule().executeQuery(query).then((e) => {
console.log(e.result);
grid.pdfExport({ dataSource: e.result }); //Export the filtered data.
}).catch((e) => {
console.log(e);
})
}
},
enableVirtualization: true,
height: 400,
. . .
. . .
});
grid.appendTo('#Grid');
</script> |