Datatables initial rows - javascript

I am trying to inital show up a specified number of rows with Datatables.
For example -> showing row 100-105.
Anyone knowing if it is possible using the options?

From the documentation:
iDisplayLength Number of rows to display on a single
page when using pagination. If feature enabled (bLengthChange) then
the end user will be able to over-ride this to a custom setting using
a pop-up menu.
iDisplayStart Define the starting point for data display
when using DataTables with pagination. Note that this parameter is the
number of records, rather than the page number, so if you have 10
records per page and want to start on the third page, it should be
"20".

Related

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.

Programmatically setting the number of displayed rows in a Bootgrid table

Hi I'm writing a web app using rails and as part of it I am displaying data to the user using jQuery Bootgrid. As part of this the user is able to set the number of rows per page of the table. I'd like to be able to have this setting persist between page loads.
When a user chooses an option for the number of rows to display I am able to capture that and store in a model. However Bootgrid doesn't seem to have a simple way of programmatically setting the number of rows. This seems like a common thing to want to do so if anyone has come across this before and can give some help it would be greatly appropriated.
you can find a "setRowCount" implemented in
https://github.com/rstaib/jquery-bootgrid/issues/215 - jquery.bootgrid.modified.txt
Unfortunately the user didn't see fit to properly fork the repo.
Not my best code but it is working:
With jquery fire click event of number of rows that you want...
$("#grid-basic1-header .dropdown:visible [data-action='-1']").click();

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

Kibana - dashboard to find something and display nearby records from logs

I've configured ELK stack for our system (.NET application). It works good but in current configuration it's not convenient to search for some text and display results with nearby application logs in the table (for example, I want to trace how particular object was moving through functions in code).
I've made a dashboard that consists of a textbox, set of filters, a graph of events and two tables - one for search results and the second for all events.
The task I want to complete:
1) Enter the query in the search box
2) Display results in both the graph and the first table.
3) By clicking a point in the graph or a row in the table (or maybe a link in ID field) second table should display item with the same id as clicked AND all next records (up to the page limit of the table).
For now with the existing dashboard I can proceed with first two steps, but the third one is done manually by reducing the time period in the graph so that the table of events contains found record and several surrounding.
Can this be done in Kibana? Probably, I can write some javascript code to complete the task.
How could I filter the table with javascript to select a row by ID and also select PageLimit - 1 next reords?
Or another way could be to filter the table by time so that its range becomes from the time of selected event to (for example) next five minutes.
Is there any documentation with javascript API for Kibana?
Thanks in advance!
This is not built into kibana 3 nor the current version of kibana 4. My suggestion would be to edit the table display to add a new link to each row. The link could be populated with the object_id and date range (+/- 15 min, etc) and open a kibana page in a new window.
This would be based around the Templates and Scripts functionality.

Categories

Resources