question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

server side paging value is not displayed

See original GitHub issue

I try to use bootstrap-table and do a server side paging

<table id="contractorTableResult" style="min-height:200" data-show-header="true" data-classes="table table-no-bordered" data-toggle="table"   data-pagination="true" data-height="230">
    <thead>
    <tr>
    <th data-field="contractorId">#</th>
    <th data-field="contractorName">Name</th>
    </tr>
    </thead>
</table>

When i show my tab i do

$("#contractorTableResult"').bootstrapTable({url:"http://localhost:8080/rest/contractor", sidePagination:"server", responseHandler:"responseHandler"});

I created a handler because i use spring data and pagination seem different then bootstrap-table

function responseHandler(res) {
        return {
            rows: res.content,
            total: res.totalElements,
            pageNumber: res.number+1,
            pageSize:res.size
        }
}

When i debug, i see the response have some data… but bootstrap table display: No matching records found

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mctdicommented, May 16, 2016

To work with spring data this code worked

$("#memberReportTableResult").bootstrapTable({
                url: getHostName() + "/members",
                queryParamsType: "",
                responseHandler: function (res) {
                    return {
                        rows: res.content,
                        total: res.totalElements,
                        pageNumber: res.number,
                        pageSize: res.size
                    };
                },
                queryParams: function (params) {
                    return {
                        number: params.pageNumber,
                        size: params.pageSize,
                    };
                }
            });
0reactions
YukunSuncommented, Jun 24, 2016

hello , do you know how can i put the jsonp data into the bootstrap table? @mctdi this is my code : var $table = $('#brand_table_list'); var result; $table.bootstrapTable({ url : '${jsonp}/brand/list?callback=callback', //data:rows, queryParams: queryParams, responseHandler:function (res){ debugger;**//this function does not work!!!** return { //.... }; }, rowStyle:rowStyle, columns : [{ field : 'body.page.list.sid', title : 'sid', }, { field : 'brandSid', title : 'BRAND_SID', }, { field : 'brandName', title : 'BRAND_NAME' }, { field : 'optRealName', title : 'OPT_REAL_NAME' }, { field : 'optUpdateTime', title : 'OPT_UPDATE_TIME' }] });

Read more comments on GitHub >

github_iconTop Results From Across the Web

Datatable pagination not showing using serverSide
I am using JQuery Datatable to display data from database and everything works well except the pagination numbers are not showing and I ......
Read more >
Pagination on server side calls doesn't seem to be working ...
When I run the call with endrow or maxrows set on the data build, the total rows and filtered rows seems to be...
Read more >
Grid server side pagination with PHP - serverPaging not working
Can anyone assist in getting my Grid working so that it pulls from the database and displays 50 rows at a time? It...
Read more >
Display Data in Tables - Pagination - Appsmith
Enable the server-side pagination property in the table; Call the API / Query onPageChange; Configure pagination in the API / Query. Offset Based...
Read more >
Angular Material Data Table: A Complete Example
... Angular Material Data Table with server-side pagination, sorting, filtering, ... This data table will display a list of course lessons, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found