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 pagination not displaying pages or row count ; search not working ; sort not working

See original GitHub issue

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.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
jaydeepgiricommented, Mar 9, 2016

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…

1reaction
jaydeepgiricommented, Mar 28, 2016

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…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Search and Pagination not working while using server-side
I am using the server-side. I am getting the records using ajax. My issue is, search and pagination not working.
Read more >
bootstrap-table with server-side pagination not working ...
This table has ~50 rows in it, and correctly makes 5 pages, assuming the default 10 records per page, yet actually displays all...
Read more >
Present data in tables
Tables are a common way to view and interact with your data. You can sort, filter, paginate, and download rows of information. Tables...
Read more >
ag-Grid Row Models: Infinite Scrolling
The grid cannot do sorting or filtering for you, as it does not have all of the data. Sorting or filtering must be...
Read more >
Paginate search results | Elasticsearch Guide [8.5]
To prevent against issues caused by having too many scrolls open, the user is not allowed to open scrolls past a certain limit....
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