JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › Grid exportData not working with Pager
Tagged: #grid #exportData #Pager
- This topic has 1 reply, 2 voices, and was last updated 3 years, 4 months ago by admin.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
July 13, 2021 at 2:18 pm #102051Dark BeccioMember
HI,
when i call grid.exportData with pager enabled, data exported are the rows in the first page.
How can i export the whole dataSource of the grid with pager?July 14, 2021 at 8:40 am #102052adminKeymasterHi Dark Beccio,
Could you post a sample which demonstrates that?
The following code which is a modification of our Data Export example with Paging enabled data exports the full data set, not only the first page’swindow.Smart('#grid', class { get properties() { return { dataSource: new window.Smart.DataAdapter({ dataSource: window.generateData(100), dataFields: [ 'id: number', 'firstName: string', 'lastName: string', 'productName: string', 'quantity: number', 'price: number', 'total: number' ] }), pager: { visible: true }, paging: { enabled: true }, columns: [ 'id', { label: 'First Name', dataField: 'firstName' }, { label: 'Last Name', dataField: 'lastName' }, { label: 'Product', dataField: 'productName' }, { label: 'Quantity', dataField: 'quantity', align: 'right', cellsAlign: 'right', }, { label: 'Unit Price', dataField: 'price', align: 'right', cellsAlign: 'right', cellsFormat: 'c2' }, { label: 'Total', dataField: 'total', align: 'right', cellsAlign: 'right', cellsFormat: 'c2' } ] }; }});function init() { const grid = document.querySelector('jqx-grid'); const xlsxBtn = document.querySelector('#xlsxBtn'); const pdfBtn = document.querySelector('#pdfBtn'); const csvBtn = document.querySelector('#csvBtn'); const tsvBtn = document.querySelector('#tsvBtn'); const xmlBtn = document.querySelector('#xmlBtn'); const htmlBtn = document.querySelector('#htmlBtn'); xlsxBtn.addEventListener('click', () => { grid.exportData('xlsx'); }); pdfBtn.addEventListener('click', () => { grid.exportData('pdf'); }); csvBtn.addEventListener('click', () => { grid.exportData('csv'); }); tsvBtn.addEventListener('click', () => { grid.exportData('tsv'); }); xmlBtn.addEventListener('click', () => { grid.exportData('xml'); }); htmlBtn.addEventListener('click', () => { grid.exportData('html'); });}
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/ -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.