Is that a Bug? Server pagination mode cannot export all data to excel
See original GitHub issueHi guys,
Newbie’s here , I like your wonderful project!
Now i got some trouble,when I set server pagination mode,I try to export all data to excel, but it doesnt work, just got current page ,I have searched all the issues on the site,but can not find out solution. please help~
here is the code:
<script src="/table/js/bootstrap-table.min.js"></script>
<script src="/table/js/bootstrap-table-zh-CN.min.js"></script>
<script src="/table/js/jquery.base64.js"></script>
<script src="/table/js/bootstrap-table-export.js"></script>
<script src="/table/js/tableExport.js"></script>
<script type="text/javascript" src="/table/js/FileSaver.min.js"></script>
<table id="mytab" class="table table-hover" ></table>
$(function() { $('#mytab').bootstrapTable({ url:'test.php', dataField: 'rows', striped:true, pagination: true, pageSize: 20, pageList: [5, 10, 20, 50], sidePagination: 'server', contentType: 'application/x-www-form-urlencoded', dataType: 'json', method: 'post', queryParamsType: 'limit',//查询参数组织方式 queryParams: function getParams(params) { params.other = 'otherInfo'; return params; }, searchOnEnterKey: false, showRefresh: true, showColumns: true, buttonsAlign: 'left', toolbar: '#toolbar', toolbarAlign: 'right', showFooter:true, showExport:true, exportDataType: 'all',
columns: [ { title: '全选', field: 'select', checkbox: true, width: 20,//宽度 align: 'center',//水平 valign: 'middle'//垂直 }, { title: 'ID',//标题 field: 'id',//键名 sortable: true,//是否可排序 order: 'desc'//默认排序方式 }, { field: 'name', title: 'NAME', sortable: true, titleTooltip: 'this is name' }, { field: 'age', title: 'AGE', sortable: true, footerFormatter:'sumFormatter' }, { field: 'info', title: 'INFO[using-formatter]', formatter: 'infoFormatter'//对本列数据做格式化 } ] }); })
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
Yes the fix works. It should be merged to master.
I found a workaround In the function load ( BootstrapTable.prototype.load = function (data) { ) I changed the if condition if (this.options.sidePagination === ‘server’) TO if (this.options.pagination && this.options.sidePagination === ‘server’)
Line 2388 in file bootstrap-table.js (version 1.11.1), now it export all the data.
Anyway, it’s still the best grid that i know, regards.