bootstrap-table: server-side pagination not displaying pages or row count ; search not working ; sort not working

Hi. I’m new here. I just switched my pagination over to server-side, with the default parameters, as indicated on the example page, and a bunch of javascript related things aren’t working.

  • My table of 32 rows displays all the rows in one table, with no pages. It also now returns at the bottom

‘Showing 1 to 0 of 0 rows’ , with no page controls on the right-hand side.

My table is set set up like

<table class='sastable' id='table' data-toggle='table' data-classes='table table-condensed table-bordered' data-sort-name="{{'plate' if stage=='3d' else 'mjd'}}" data-sort-order='asc'
    data-show-columns='true' data-pagination='true' data-search='true' pageSize='25' 
    data-select-item-name='input' data-toolbar='#toolbar' data-id-field='id' 
    data-side-pagination='server' data-page-list="[10, 25, 50, 100]" name='sastable'>
 </table>

Am I missing something in the setup to activate it? I could not find another issue related to this one.

Am I missing some javascript somewhere to get the server-side pagination set up properly?

Thanks for your help.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 39 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks a lot again @wenzhixin for such a great work.

Now everything is working fine on my server side pagination table ( Sorting, Searching etc., )

Hello guys i would like to let you know people that, Please utilize the following parameters inGET method to perform the database query.on server side–>

$_GET['sort'] -->> gives you the column name of the table to sort $_GET['order'] -->> specifies the order i.e, ASC or DESC $_GET['search']–>> gives the text to search into database $_GET['limit']–>> specifies number of rows $_GET['offset']–>> starting position / offset in table

Please avoid confusions and go for this.

Thank you…

Hello @nyarachm, I am glad to know that my small work helped you…

Now for searching it is done in the same way, i’ll show you my piece of code for the same…

below is the mysql - PHP code–>>

$where='';
if(isset($_GET['search'])){
    $searchText = $_GET['search'];
    $where = "WHERE  `title` LIKE  '%".$searchText."%'";
}
$query=' select `id`,`title`, `description`,`date`  from `products` '. $where .' limit '.$offset.','.$limit;

It is that simple as shown above…

@jaydeepgiri Can I see how you got your search working (particularly the PHP script)? I do not know how to go about this. I also had issues with the sort but thanks to the variables you posted I got it working.

WHERE x=4 LIMIT $offset, $limit

OK, I thought it was resolved by mistake.