Using tablesorter plugin with a large amount of data - javascript

So I currently have a set of data that is about 5000 records. I have been using the tablesorter plugin and it has worked great for my smaller tables.
however the way I have it set up currently on the page with the large amount of records is that it retrieves all the records from the database and populates the data into the browser and then the tablesorter plugin with break it into pages of 100 records.
my issue is that the I need to get it working in a way where it will load up the first 100 records and have it so it doesn't load the next 100 records until I hit the next page button. But I still have to be able to sort through all 5000 records if I sort by any of the headers.
I am some what new to working with this so I am not sure how I could go about doing that.
so to summarise
I have 5000 records
I want to have 100 of those records display when the page loads
if I sort by any of the headers it needs to sort through all 5000 records
if I hit the next page button it needs to load up the next 100 records in line.

You should give datatables a try then.

Tablesorter has a pager plugin that can handle server side paging requests. Here's a link to the example:
http://mottie.github.io/tablesorter/docs/example-pager-filtered.html
You can run ajax requests that will handle that pagination, as well as sorting and filtering. However, you'll have to build the calls to the server. The process is pretty well documented in the documentation on Mottie's Tablesorter fork. I recently used Tablesorter to handle a table with 50,000 rows.

Related

Given a table with multiple pages on a webpage how can I access data for all pages from chrome?

I have a table with 100 rows which is displayed 20 rows at a time on a webpage. I can view the next 20 rows by clicking "next page" which updated the table view on my webpage. I can access the data for each batch of 20 rows via the developer/inspect browser tools. Is there anyway to get this for all 100 rows at once? The webpage is only accessible after logging in, i.e. the data is not publicly available.
It depends what the page is doing.
If the 100 rows aren't loaded on the browser at once then no you can't get them. For example the page may be calling a web service to load 20 at a time.
You would have to understand how the page acquires the rows and then replicate that with some javascript in order to pull back more at once.
You may also be able to use the console/debugging tools to edit the code on the page to make it load more at once. Really it's very dependent on the specifics of what the page is doing.

How do I display database rows on multiple pages with Ajax?

I have a database with a table having a big number of rows. I am fetching the data in this table and displaying it in an HTML table on a web page.
My requirement is to display 20 records initially and then when the user clicks a button labelled Next, I show the next 20 records and so on...
So I have initially fetched first 20 rows from the table in my PHP (server-side), and then assigned a JS function to the onclick attribute of the button labelled Next. Inside this JS function, I use an AJAX call which brings me the next 20 rows. Then within this JS function, I replace the HTML rows with these new rows.
I need something like this:
The question is that are there any plugins available which can implement that functionality for me? If a plugin is available, implementing it manually wouldn't make sense because being a rookie, I can't develop it better than the developers of that plugin.
Yes
This is called pagination - a quick search for "ajax pagination mysql php" or similar brings up a wide range of options. I can't recommend any particular one as your question is too broad; I can only reasonably go as far as a definition.
Internally they use the MySQL LIMIT keyword which may help give further things to search for or experiment with depending on your actual use case.

How can I set custom values to jqgrid Paginator?

I have a problem, I would like to load a jqgrid with many rows, but its too many information to be a process on the server side, them I like set manually a jqgrid paginator the total rows and page and when a do click in next page go to server and get the next group of rows.
Thank, for you help

Is it possible to set pagination numbers with the total record returned by the server and number of records selected by the user in Jquery DataTable?

I am new to DataTable.js jquery plugin and trying to put my best effort to explain the stuff I want to know.
As of my requirement, I have to fetch only 10 records by default at a time when I do an ajax request even it match 100 records with the search criteria.
But the no. of records will change based on the user selection. ie. it may be 5 or 10 or 25 and so on which is available in the show records per page dropdown control.
Ex.
Consider I have 50 records that matches my search criteria and I selected 10 records to show per page. So the first ajax request provide only 10 records and it will be displayed in the table. At the same time I have to show the pagination as 1 2 3 4 5 buttons.
I want to know how to set the pagination like above using total no. of records and no. records shown per page?
Is there any way to do this?
Any help will appreciate!.
Data table basically works on html table and create pagination on table data. Datatable does not provide this type of functionality. may be following link help you
Ajax request for server side data for each page in Datatables

Jquery Table plugin

I need a table plugin that does the following
Uses json and html table as the datasource
supports pagination
can specify how many rows to show by the user(i.e user can change rows per page)
sorting of columns
searching (complex searching options is welcome)
free for commercial projects
dynamic addition/deletion
refresh option
Finally the main requirement is searching, sorting,pagination all needs to happen client side. No server interaction needed.
One more thing dont know if possible say i have 1000 records i want 100 to show up initially in 10 pages (i.e 10 each in 10 pages) only when user clicks on page 11 it fetches next 10 from server
Thanks
The jQuery DataTables are really pretty, and easy to use. http://www.datatables.net/ Lets you roll your own theme super easy. You can build from html or ajax.
You can go check out http://flexigrid.info/ . Its not a table exactly its a grid but you might be able to use it in the same way. It accepts JSON and allows a lot of different ways to change display.
this is what you're looking for: http://www.trirand.com/blog/jqgrid/jqgrid.html

Categories

Resources